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
{{ message }}
Repository navigation
Failure to refine generic argument of type extends boolean #41333
Narrowing doesn't quite work this way and it'd be difficult to make it do this without breaking other behavior. Ideally it'd be something like TValue & true but that kind of analysis only makes sense on unit values like true and false, but it's rarely useful to write generics that operate like that.
Activity
RyanCavanaugh commentedon Nov 10, 2020
Narrowing doesn't quite work this way and it'd be difficult to make it do this without breaking other behavior. Ideally it'd be something like
TValue & truebut that kind of analysis only makes sense on unit values liketrueandfalse, but it's rarely useful to write generics that operate like that.0rvar commentedon Nov 11, 2020
Could you elaborate?
Here's a slightly contrived use case: