-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Design LimitationConstraints of the existing architecture prevent this from being fixedConstraints of the existing architecture prevent this from being fixed
Description
TypeScript Version: 4.0, nightly
Search Terms:
Generic, refinement, refine, extends boolean
Code
function foo<TValue extends boolean>(value: TValue) {
if (value === true) {
const truthy: true = value
}
}Expected behavior:
TValue should be refined to true. At the very least, the value variable should.
Actual behavior:
Error:
Type 'TValue' is not assignable to type 'true'.
Type 'boolean' is not assignable to type 'true'.(2322)
jonhuecaptain-yossarian
Metadata
Metadata
Assignees
Labels
Design LimitationConstraints of the existing architecture prevent this from being fixedConstraints of the existing architecture prevent this from being fixed