-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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[][]> = TThis 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScript