-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Regression on Promise Type Checking in Latest Insiders #15352
Comments
This is an intentional change to tighten the promise compatibility checking. in your call back, inference fails, and the result is See https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#covariance-in-callback-parameters for more details |
Thanks. This change seems to make sense even though it will be a little painful to update our codebase for it. It was not entirely clear to me why the code was compiling in ts 2.2.2 case when I looked at the types and thought more about the problem. // cc @bpasero |
From: microsoft/TypeScript#15352 TS 2.3.1 introduced a breaking change around checking of generic types. This change tries to fix these compiler errors in the extensions codebase
From: microsoft/TypeScript#15352 TS 2.3.1 introduced a breaking change around checking of generic types. This change tries to fix these compiler errors in the extensions codebase
From: microsoft/TypeScript#15352 TS 2.3.1 introduced a breaking change by [switching to covariant types for callbacks](https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#covariance-in-callback-parameters). This change tries to fix these compiler errors in the workbench codebase
From: microsoft/TypeScript#15352 TS 2.3.1 introduced a breaking change by [switching to covariant types for callbacks](https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#covariance-in-callback-parameters). This change tries to fix these compiler errors in the workbench codebase
From: microsoft/vscode#25215
TypeScript Version: 2.3.1-insiders0420
Code
Using
es2015.lib.d.ts
:Expected behavior:
This compiles fine with TS 2.2.2 and with the older insiders 2.3.1 release.
Actual behavior:
With the current insiders, we get:
message: 'Argument of type 'Promise<{}>' is not assignable to parameter of type 'Promise<boolean>'. Type '{}' is not assignable to type 'boolean'.'
This is causing upwards of 230 compiler errors in the vscode codebase
Possible related to #15104
The text was updated successfully, but these errors were encountered: