mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-09 20:51:43 -06:00
Add regression test
This commit is contained in:
parent
e71afc32ad
commit
57ef618120
@ -567,3 +567,12 @@ function f3<T, K extends Extract<keyof T, string>>(t: T, k: K, tk: T[K]): void {
|
||||
type Predicates<TaggedRecord> = {
|
||||
[T in keyof TaggedRecord]: (variant: TaggedRecord[keyof TaggedRecord]) => variant is TaggedRecord[T]
|
||||
}
|
||||
|
||||
// Repros from #23592
|
||||
|
||||
type Example<T extends { [K in keyof T]: { prop: any } }> = { [K in keyof T]: T[K]["prop"] };
|
||||
type Result = Example<{ a: { prop: string }; b: { prop: number } }>;
|
||||
|
||||
type Helper2<T> = { [K in keyof T]: Extract<T[K], { prop: any }> };
|
||||
type Example2<T> = { [K in keyof Helper2<T>]: Helper2<T>[K]["prop"] };
|
||||
type Result2 = Example2<{ 1: { prop: string }; 2: { prop: number } }>;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user