-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug

Description
TypeScript Version: 2.8.0-dev.20180302
Code
function* f() {
yield 0;
return "";
}
for (const x of f()) {
const n: number = x;
}
Expected behavior:
No error.
Actual behavior:
src/a.ts(7,11): error TS2322: Type '"" | 0' is not assignable to type 'number'.
Type '""' is not assignable to type 'number'.
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug