We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
TypeScript Version: 3.0.0-dev.20180601
Search Terms: for iterable
Code
// @target: esnext async function main(p: Iterable<Promise<number>>) { for await (const item of p) { item; // should be of type 'number' } }
Expected behavior:
item should be of type number to match the runtime value
item
number
Actual behavior:
item is incorrectly inferred as Promise<number>
Promise<number>
Playground Link: https://agentcooper.github.io/typescript-play/?target=5#code/IYZwngdgxgBAZgV2gFwJYHsIwLbFRACgAcAuGASWQFMAnYAIwBsqAeABRvW1RFYgWz1aAPmEBKGAG8AUDDnx0NGMADueZDAJRMIDamrYY6ODCISZ8yzH1VsAblnyAvtKdA
Related Issues: #21115 This issue contains a detailed explanation and is not (completely) fixed by the recent changes by @rbuckton
The text was updated successfully, but these errors were encountered:
rbuckton
No branches or pull requests
TypeScript Version: 3.0.0-dev.20180601
Search Terms: for iterable
Code
Expected behavior:
item
should be of typenumber
to match the runtime valueActual behavior:
item
is incorrectly inferred asPromise<number>
Playground Link: https://agentcooper.github.io/typescript-play/?target=5#code/IYZwngdgxgBAZgV2gFwJYHsIwLbFRACgAcAuGASWQFMAnYAIwBsqAeABRvW1RFYgWz1aAPmEBKGAG8AUDDnx0NGMADueZDAJRMIDamrYY6ODCISZ8yzH1VsAblnyAvtKdA
Related Issues:
#21115 This issue contains a detailed explanation and is not (completely) fixed by the recent changes by @rbuckton
The text was updated successfully, but these errors were encountered: