From 2c951b3ca99751c98a23d1bb707803264f0f6bdf Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sat, 13 Apr 2019 08:24:27 -1000 Subject: [PATCH] Add regression test --- .../types/intersection/intersectionWithUnionConstraint.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts b/tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts index 278d72595cd..2a756788f6f 100644 --- a/tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts +++ b/tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts @@ -34,3 +34,8 @@ type Example = { [K in keyof T]: K extends keyof U ? UnexpectedError : type UnexpectedError = T type NoErrorHere = T + +// Repro from #30331 + +type a = T extends Array ? U : never; +type b = { [K in a & keyof T ]: 42 };