-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScript
Description
Bug Report
π Search Terms
conditional types, generics, deep, predicate
π Version & Regression Information
This changed between versions 4.8.4 and 4.9.4
β― Playground Link
Playground link with the code bellow
π» Code
type Foo<A,B> = [A, B] extends unknown[][] ? Bar<[A, B]> : 'else'
// ~~~~~~
// Type '[A, B]' does not satisfy the constraint 'unknown[][]'.
type Bar<T extends unknown[][]> = T
This is not limited to tuples
type Foo<A> = Set<A> extends Set<unknown[]> ? Bar<Set<A>> : 'else'
// ~~~~~
// Type 'Set<A>' does not satisfy the constraint 'Set<unknown[]>'.
type Bar<T extends Set<unknown[]>> = T
π Actual behavior
There is a type error that literally contradicts the predicate of the conditional
π Expected behavior
It should compile with no error
whzx5byb and Tobias-Scholz
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScript