Open
Description
π Search Terms
T to null
π Version & Regression Information
- This is a type narrowing issue
- This is the behavior in every version I tried
β― Playground Link
π» Code
function isNull<T>(value: T) {
if (value === null) {
value // T, should be null
}
return value === null;
}
π Actual behavior
value is T inside the if block of value === null (explicit comparison)
π Expected behavior
value should be of type null inside the if block of value === null
Additional information about the issue
No response