-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
es6.d.ts has incorrect signature for console.log #4755
Labels
Bug
A bug in TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Comments
until this is fixed, you can explicitly add the overload to one of your files: interface Console {
log(message?: any, ...optionalParams: any[]): void;
log(...optionalParams: any[]): void;
}
function puts(...optionalParams: any[]): void {
console.log(...optionalParams);
} |
This isn't wrong, this is a limitation of our semantics for the spread operator. |
@DanielRosenwasser do you mind filing an issue for that. |
Filed #4759. I'd rather we fixed that instead of the signature for |
Agreed. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
Bug
A bug in TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
The default signature for console.log is wrong.
log(message?: any, ...optionalParams: any[]): void;
See this code example:
If I update the signature to
log(...optionalParams: any[]): void;
then it works.The text was updated successfully, but these errors were encountered: