-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: check: Control FlowThe issue relates to control flow analysisThe issue relates to control flow analysisHelp WantedYou can do thisYou can do this
Description
π Search Terms
logical and, generic, NonNullable
π Version & Regression Information
There has been this problem since 4.8.4 (I tried it on the playground)
β― Playground Link
π» Code
const f = <T,>(x: T) => x && x // <T>(x: T) => NonNullable<T>π Actual behavior
Since f returns NonNullable<T>, we can make every value NonNullable, and never can be created by calling f(null).
π Expected behavior
f should return T.
Additional information about the issue
No response
kirkwaiblinger, jcalz, 976520, uhyo and esheyw
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: check: Control FlowThe issue relates to control flow analysisThe issue relates to control flow analysisHelp WantedYou can do thisYou can do this