mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-21 08:25:43 -05:00
Fixed distributive conditional types with never intersections (#57345)
This commit is contained in:
committed by
GitHub
parent
c5db0ac0ef
commit
e2bf8b437d
@@ -0,0 +1,12 @@
|
||||
// @strict: true
|
||||
// @noEmit: true
|
||||
|
||||
// https://github.com/microsoft/TypeScript/issues/57343
|
||||
|
||||
type IsNumber<T> = T extends number ? true : false;
|
||||
|
||||
type Conflicted = { x: true } & { x: false };
|
||||
|
||||
type Ex1 = IsNumber<Conflicted>; // never
|
||||
type Ex2 = IsNumber<"OEEE" | Conflicted>; // false
|
||||
type Ex3 = IsNumber<1 | Conflicted>; // true
|
||||
Reference in New Issue
Block a user