diff --git a/tests/cases/conformance/types/conditional/inferTypes2.ts b/tests/cases/conformance/types/conditional/inferTypes2.ts index fbf4ca808336e..77b910c511385 100644 --- a/tests/cases/conformance/types/conditional/inferTypes2.ts +++ b/tests/cases/conformance/types/conditional/inferTypes2.ts @@ -14,3 +14,11 @@ export declare function foo2(obj: T): T extends { [K in keyof BadNested(obj: T) { return foo2(obj); } + +// Repros from #31099 + +type Weird = any extends infer U ? U : never; +type AlsoWeird = unknown extends infer U ? U : never; + +const a: Weird = null; +const b: string = a;