-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Description
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
Actual behavior:
item is incorrectly inferred as Promise<number>
Related Issues:
#21115 This issue contains a detailed explanation and is not (completely) fixed by the recent changes by @rbuckton
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScript