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 that both test1 and test2 would behave identically and both type check.
Actual behavior:test2 does not correctly infer that value on the second half of the branch is number, and instead states that Number.isSafeInteger(number | null) is not possible, despite the fact that null was already checked for.
TypeScript Version: v3.8.0-dev.20191212
Search Terms:
extends null
, type guards, inferenceExpected behavior: I would expect that both
test1
andtest2
would behave identically and both type check.Actual behavior:
test2
does not correctly infer thatvalue
on the second half of the branch isnumber
, and instead states thatNumber.isSafeInteger(number | null)
is not possible, despite the fact that null was already checked for.Related Issues: #29627 (closed)
Code
Output
Compiler Options
Playground Link: Provided
The text was updated successfully, but these errors were encountered: