Skip to content

Commit 2c951b3

Browse files
committed
Add regression test
1 parent b9f805f commit 2c951b3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/cases/conformance/types/intersection/intersectionWithUnionConstraint.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,8 @@ type Example<T, U> = { [K in keyof T]: K extends keyof U ? UnexpectedError<K> :
3434

3535
type UnexpectedError<T extends PropertyKey> = T
3636
type NoErrorHere<T extends PropertyKey> = T
37+
38+
// Repro from #30331
39+
40+
type a<T> = T extends Array<infer U> ? U : never;
41+
type b<T> = { [K in a<T> & keyof T ]: 42 };

0 commit comments

Comments
 (0)