diff --git a/tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts b/tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts index b406dd91586..278d72595cd 100644 --- a/tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts +++ b/tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts @@ -16,6 +16,18 @@ function f2(x: T & (number | object | undefined)) { + const y: number | undefined = x; +} + +function f4(x: T & (number | object)) { + const y: number = x; +} + +function f5(x: keyof T & U) { + let y: keyof any = x; +} + // Repro from #23648 type Example = { [K in keyof T]: K extends keyof U ? UnexpectedError : NoErrorHere }