Skip to content

Commit 0783757

Browse files
committed
Add regression test
1 parent 5a567ad commit 0783757

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/cases/conformance/types/conditional/inferTypes2.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,11 @@ export declare function foo2<T>(obj: T): T extends { [K in keyof BadNested<infer
1414
export function bar2<T>(obj: T) {
1515
return foo2(obj);
1616
}
17+
18+
// Repros from #31099
19+
20+
type Weird = any extends infer U ? U : never;
21+
type AlsoWeird = unknown extends infer U ? U : never;
22+
23+
const a: Weird = null;
24+
const b: string = a;

0 commit comments

Comments
 (0)