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:
Compilation passes, TS should know that .map function will be executed immediately and so maybeNumber will not be null
Actual behavior:
Compilation error: error TS2531: Object is possibly 'null'
Weird:
When I change let maybeNumber to const maybeNumber compilation passes for some reason, even though type of maybeNumber should be still number | null
The text was updated successfully, but these errors were encountered:
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
TypeScript Version: 2.3.4
Code
Expected behavior:
Compilation passes, TS should know that .map function will be executed immediately and so
maybeNumber
will not benull
Actual behavior:
Compilation error:
error TS2531: Object is possibly 'null'
Weird:
When I change
let maybeNumber
toconst maybeNumber
compilation passes for some reason, even though type ofmaybeNumber
should be stillnumber | null
The text was updated successfully, but these errors were encountered: