You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior:
I would expect yield; (without expression) to be forbidden if the generator return type (IterableIterator<number>) doesn't allow undefined.
Actual behavior:
This compiles fine, prints 'undefined', '2' (we're essentially allowing undefined to be assigned to non-nullable number).
TypeScript Version: 2.8.0-dev.20180302
Search Terms: generator, yield, strictNullChecks, typechecking
Code
tsconfig.json:
Expected behavior:
I would expect
yield;
(without expression) to be forbidden if the generator return type (IterableIterator<number>
) doesn't allow undefined.Actual behavior:
This compiles fine, prints 'undefined', '2' (we're essentially allowing
undefined
to be assigned to non-nullablenumber
).Playground Link: link
The text was updated successfully, but these errors were encountered: