|
|
|
|
@@ -2010,64 +2010,113 @@ type Predicates<TaggedRecord> = {
|
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 564, 3))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Repros from #23592
|
|
|
|
|
|
|
|
|
|
type Example<T extends { [K in keyof T]: { prop: any } }> = { [K in keyof T]: T[K]["prop"] };
|
|
|
|
|
>Example : Symbol(Example, Decl(keyofAndIndexedAccess.ts, 565, 1))
|
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 569, 13))
|
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 569, 26))
|
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 569, 13))
|
|
|
|
|
>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 569, 42))
|
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 569, 63))
|
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 569, 13))
|
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 569, 13))
|
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 569, 63))
|
|
|
|
|
|
|
|
|
|
type Result = Example<{ a: { prop: string }; b: { prop: number } }>;
|
|
|
|
|
>Result : Symbol(Result, Decl(keyofAndIndexedAccess.ts, 569, 93))
|
|
|
|
|
>Example : Symbol(Example, Decl(keyofAndIndexedAccess.ts, 565, 1))
|
|
|
|
|
>a : Symbol(a, Decl(keyofAndIndexedAccess.ts, 570, 23))
|
|
|
|
|
>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 570, 28))
|
|
|
|
|
>b : Symbol(b, Decl(keyofAndIndexedAccess.ts, 570, 44))
|
|
|
|
|
>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 570, 49))
|
|
|
|
|
|
|
|
|
|
type Helper2<T> = { [K in keyof T]: Extract<T[K], { prop: any }> };
|
|
|
|
|
>Helper2 : Symbol(Helper2, Decl(keyofAndIndexedAccess.ts, 570, 68))
|
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 572, 13))
|
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 572, 21))
|
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 572, 13))
|
|
|
|
|
>Extract : Symbol(Extract, Decl(lib.d.ts, --, --))
|
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 572, 13))
|
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 572, 21))
|
|
|
|
|
>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 572, 51))
|
|
|
|
|
|
|
|
|
|
type Example2<T> = { [K in keyof Helper2<T>]: Helper2<T>[K]["prop"] };
|
|
|
|
|
>Example2 : Symbol(Example2, Decl(keyofAndIndexedAccess.ts, 572, 67))
|
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 573, 14))
|
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 573, 22))
|
|
|
|
|
>Helper2 : Symbol(Helper2, Decl(keyofAndIndexedAccess.ts, 570, 68))
|
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 573, 14))
|
|
|
|
|
>Helper2 : Symbol(Helper2, Decl(keyofAndIndexedAccess.ts, 570, 68))
|
|
|
|
|
>T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 573, 14))
|
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 573, 22))
|
|
|
|
|
|
|
|
|
|
type Result2 = Example2<{ 1: { prop: string }; 2: { prop: number } }>;
|
|
|
|
|
>Result2 : Symbol(Result2, Decl(keyofAndIndexedAccess.ts, 573, 70))
|
|
|
|
|
>Example2 : Symbol(Example2, Decl(keyofAndIndexedAccess.ts, 572, 67))
|
|
|
|
|
>1 : Symbol(1, Decl(keyofAndIndexedAccess.ts, 574, 25))
|
|
|
|
|
>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 574, 30))
|
|
|
|
|
>2 : Symbol(2, Decl(keyofAndIndexedAccess.ts, 574, 46))
|
|
|
|
|
>prop : Symbol(prop, Decl(keyofAndIndexedAccess.ts, 574, 51))
|
|
|
|
|
|
|
|
|
|
// Repro from #23618
|
|
|
|
|
|
|
|
|
|
type DBBoolTable<K extends string> = { [k in K]: 0 | 1 }
|
|
|
|
|
>DBBoolTable : Symbol(DBBoolTable, Decl(keyofAndIndexedAccess.ts, 565, 1))
|
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 569, 17))
|
|
|
|
|
>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 569, 40))
|
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 569, 17))
|
|
|
|
|
>DBBoolTable : Symbol(DBBoolTable, Decl(keyofAndIndexedAccess.ts, 574, 70))
|
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 578, 17))
|
|
|
|
|
>k : Symbol(k, Decl(keyofAndIndexedAccess.ts, 578, 40))
|
|
|
|
|
>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 578, 17))
|
|
|
|
|
|
|
|
|
|
enum Flag {
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 569, 56))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 578, 56))
|
|
|
|
|
|
|
|
|
|
FLAG_1 = "flag_1",
|
|
|
|
|
>FLAG_1 : Symbol(Flag.FLAG_1, Decl(keyofAndIndexedAccess.ts, 570, 11))
|
|
|
|
|
>FLAG_1 : Symbol(Flag.FLAG_1, Decl(keyofAndIndexedAccess.ts, 579, 11))
|
|
|
|
|
|
|
|
|
|
FLAG_2 = "flag_2"
|
|
|
|
|
>FLAG_2 : Symbol(Flag.FLAG_2, Decl(keyofAndIndexedAccess.ts, 571, 22))
|
|
|
|
|
>FLAG_2 : Symbol(Flag.FLAG_2, Decl(keyofAndIndexedAccess.ts, 580, 22))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type SimpleDBRecord<Flag extends string> = { staticField: number } & DBBoolTable<Flag>
|
|
|
|
|
>SimpleDBRecord : Symbol(SimpleDBRecord, Decl(keyofAndIndexedAccess.ts, 573, 1))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 575, 20))
|
|
|
|
|
>staticField : Symbol(staticField, Decl(keyofAndIndexedAccess.ts, 575, 44))
|
|
|
|
|
>DBBoolTable : Symbol(DBBoolTable, Decl(keyofAndIndexedAccess.ts, 565, 1))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 575, 20))
|
|
|
|
|
>SimpleDBRecord : Symbol(SimpleDBRecord, Decl(keyofAndIndexedAccess.ts, 582, 1))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 584, 20))
|
|
|
|
|
>staticField : Symbol(staticField, Decl(keyofAndIndexedAccess.ts, 584, 44))
|
|
|
|
|
>DBBoolTable : Symbol(DBBoolTable, Decl(keyofAndIndexedAccess.ts, 574, 70))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 584, 20))
|
|
|
|
|
|
|
|
|
|
function getFlagsFromSimpleRecord<Flag extends string>(record: SimpleDBRecord<Flag>, flags: Flag[]) {
|
|
|
|
|
>getFlagsFromSimpleRecord : Symbol(getFlagsFromSimpleRecord, Decl(keyofAndIndexedAccess.ts, 575, 86))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 576, 34))
|
|
|
|
|
>record : Symbol(record, Decl(keyofAndIndexedAccess.ts, 576, 55))
|
|
|
|
|
>SimpleDBRecord : Symbol(SimpleDBRecord, Decl(keyofAndIndexedAccess.ts, 573, 1))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 576, 34))
|
|
|
|
|
>flags : Symbol(flags, Decl(keyofAndIndexedAccess.ts, 576, 84))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 576, 34))
|
|
|
|
|
>getFlagsFromSimpleRecord : Symbol(getFlagsFromSimpleRecord, Decl(keyofAndIndexedAccess.ts, 584, 86))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 585, 34))
|
|
|
|
|
>record : Symbol(record, Decl(keyofAndIndexedAccess.ts, 585, 55))
|
|
|
|
|
>SimpleDBRecord : Symbol(SimpleDBRecord, Decl(keyofAndIndexedAccess.ts, 582, 1))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 585, 34))
|
|
|
|
|
>flags : Symbol(flags, Decl(keyofAndIndexedAccess.ts, 585, 84))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 585, 34))
|
|
|
|
|
|
|
|
|
|
return record[flags[0]];
|
|
|
|
|
>record : Symbol(record, Decl(keyofAndIndexedAccess.ts, 576, 55))
|
|
|
|
|
>flags : Symbol(flags, Decl(keyofAndIndexedAccess.ts, 576, 84))
|
|
|
|
|
>record : Symbol(record, Decl(keyofAndIndexedAccess.ts, 585, 55))
|
|
|
|
|
>flags : Symbol(flags, Decl(keyofAndIndexedAccess.ts, 585, 84))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type DynamicDBRecord<Flag extends string> = ({ dynamicField: number } | { dynamicField: string }) & DBBoolTable<Flag>
|
|
|
|
|
>DynamicDBRecord : Symbol(DynamicDBRecord, Decl(keyofAndIndexedAccess.ts, 578, 1))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 580, 21))
|
|
|
|
|
>dynamicField : Symbol(dynamicField, Decl(keyofAndIndexedAccess.ts, 580, 46))
|
|
|
|
|
>dynamicField : Symbol(dynamicField, Decl(keyofAndIndexedAccess.ts, 580, 73))
|
|
|
|
|
>DBBoolTable : Symbol(DBBoolTable, Decl(keyofAndIndexedAccess.ts, 565, 1))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 580, 21))
|
|
|
|
|
>DynamicDBRecord : Symbol(DynamicDBRecord, Decl(keyofAndIndexedAccess.ts, 587, 1))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 589, 21))
|
|
|
|
|
>dynamicField : Symbol(dynamicField, Decl(keyofAndIndexedAccess.ts, 589, 46))
|
|
|
|
|
>dynamicField : Symbol(dynamicField, Decl(keyofAndIndexedAccess.ts, 589, 73))
|
|
|
|
|
>DBBoolTable : Symbol(DBBoolTable, Decl(keyofAndIndexedAccess.ts, 574, 70))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 589, 21))
|
|
|
|
|
|
|
|
|
|
function getFlagsFromDynamicRecord<Flag extends string>(record: DynamicDBRecord<Flag>, flags: Flag[]) {
|
|
|
|
|
>getFlagsFromDynamicRecord : Symbol(getFlagsFromDynamicRecord, Decl(keyofAndIndexedAccess.ts, 580, 117))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 581, 35))
|
|
|
|
|
>record : Symbol(record, Decl(keyofAndIndexedAccess.ts, 581, 56))
|
|
|
|
|
>DynamicDBRecord : Symbol(DynamicDBRecord, Decl(keyofAndIndexedAccess.ts, 578, 1))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 581, 35))
|
|
|
|
|
>flags : Symbol(flags, Decl(keyofAndIndexedAccess.ts, 581, 86))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 581, 35))
|
|
|
|
|
>getFlagsFromDynamicRecord : Symbol(getFlagsFromDynamicRecord, Decl(keyofAndIndexedAccess.ts, 589, 117))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 590, 35))
|
|
|
|
|
>record : Symbol(record, Decl(keyofAndIndexedAccess.ts, 590, 56))
|
|
|
|
|
>DynamicDBRecord : Symbol(DynamicDBRecord, Decl(keyofAndIndexedAccess.ts, 587, 1))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 590, 35))
|
|
|
|
|
>flags : Symbol(flags, Decl(keyofAndIndexedAccess.ts, 590, 86))
|
|
|
|
|
>Flag : Symbol(Flag, Decl(keyofAndIndexedAccess.ts, 590, 35))
|
|
|
|
|
|
|
|
|
|
return record[flags[0]];
|
|
|
|
|
>record : Symbol(record, Decl(keyofAndIndexedAccess.ts, 581, 56))
|
|
|
|
|
>flags : Symbol(flags, Decl(keyofAndIndexedAccess.ts, 581, 86))
|
|
|
|
|
>record : Symbol(record, Decl(keyofAndIndexedAccess.ts, 590, 56))
|
|
|
|
|
>flags : Symbol(flags, Decl(keyofAndIndexedAccess.ts, 590, 86))
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|