-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Compiler not erroring for generic in Promise.resolve #10785
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
Comments
Closed by 9d4219a |
Actually I believe this is still an issue: const commits: Promise<number> = Promise.resolve('foo') // no error! |
should be working now. c:\test>tsc --v
Version 2.1.4
c:\test>type C:\test\sandbox8\a.ts
const commits: Promise<number> = Promise.resolve('foo') // no error!
c:\test>tsc C:\test\sandbox8\a.ts --lib es6
sandbox8/a.ts(1,7): error TS2322: Type 'Promise<string>' is not assignable to type 'Promise<number>'.
Type 'string' is not assignable to type 'number'. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Latest 2 beta
The text was updated successfully, but these errors were encountered: