Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScript
Description
The default signature for console.log is wrong.
log(message?: any, ...optionalParams: any[]): void;
See this code example:
function puts(...optionalParams: any[]): void {
console.log.apply(this, arguments); // no error
// Supplied parameters do not match any signature of call target.
// Method Console.log(message?: any, ...optionalParams: any[]): void;
console.log(...arguments); // see error above
}If I update the signature to log(...optionalParams: any[]): void; then it works.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScript
Activity
mhegazy commentedon Sep 12, 2015
until this is fixed, you can explicitly add the overload to one of your files:
DanielRosenwasser commentedon Sep 12, 2015
This isn't wrong, this is a limitation of our semantics for the spread operator.
mhegazy commentedon Sep 12, 2015
Daniel Rosenwasser (@DanielRosenwasser) do you mind filing an issue for that.
DanielRosenwasser commentedon Sep 12, 2015
Filed #4759. I'd rather we fixed that instead of the signature for
console.log.bootstraponline commentedon Sep 12, 2015
Agreed.