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