Skip to content

Commit 89a8b50

Browse files
committed
Add test
1 parent 8ff8008 commit 89a8b50

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/cases/compiler/indexingTypesWithNever.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,11 @@ declare const o3Test: ExpectType<{ a?: string; b?: number }, O3Props>;
109109
declare const o2Test: ExpectType<{ a?: string }, O2Props>;
110110
declare const o1Test: ExpectType<{}, O1Props>;
111111
declare const o0Test: ExpectType<{}, O0Props>;
112+
113+
// Repro from #23005
114+
115+
type Example<T extends Record<'a', string>> = T['a'];
116+
117+
type Res1 = Example<{ a: "x" } | { a: "y" }>; // "x" | "y"
118+
type Res2 = Example<{ a: "x" }>; // "x"
119+
type Res3 = Example<never>; // never

0 commit comments

Comments
 (0)