-
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
Incorrect type inference in promise.all #35626
Comments
Possibly related to #34937 |
Reproduced in 3.7.2 and 3.7.3. Works correctly in 3.6. |
possible duplicate of #33752 |
Link to reproduce this - even in nightly builds: |
Not sure, if this is the same problem or just related: class C1 {
data1: number;
}
class C2 extends C1 {
data2: number;
}
async test(): Promise<number> {
let [c2, c1] = await Promise.all([
Promise.resolve(<C2[]>[new C2()]),
Promise.resolve(<C1[]>[new C1()]),
]);
return c2[0].data2;
} -> Error TS2551: Property 'data2' does not exist on type 'C1'. Did you mean 'data1'? Works correctly with 3.6 but not with 3.7 |
This may have been fixed by #34501, as it does not seem to occur in TypeScript 3.9 onward. |
TypeScript Version: 3.7.x-dev.201xxxxx
Search Terms:
Code
Expected behavior:
Works correctly in typescript 3.6.4, but failed to compile in typescript@latest and typescript@next with error
Argument of type 'B | undefined' is not assignable to parameter of type 'B'.
The text was updated successfully, but these errors were encountered: