@@ -899,3 +899,27 @@ const obj3: { [key: number]: string } = { [sym]: 'hello '}; // Error
899899>[sym] : Symbol([sym], Decl(indexSignatures1.ts, 311, 41))
900900>sym : Symbol(sym, Decl(indexSignatures1.ts, 2, 5))
901901
902+ // Repro from #45772
903+
904+ type Id = string & { __tag: 'id '};
905+ >Id : Symbol(Id, Decl(indexSignatures1.ts, 311, 59))
906+ >__tag : Symbol(__tag, Decl(indexSignatures1.ts, 315, 20))
907+
908+ type Rec1 = { [key: Id]: number };
909+ >Rec1 : Symbol(Rec1, Decl(indexSignatures1.ts, 315, 35))
910+ >key : Symbol(key, Decl(indexSignatures1.ts, 316, 15))
911+ >Id : Symbol(Id, Decl(indexSignatures1.ts, 311, 59))
912+
913+ type Rec2 = Record<Id, number>;
914+ >Rec2 : Symbol(Rec2, Decl(indexSignatures1.ts, 316, 34))
915+ >Record : Symbol(Record, Decl(lib.es5.d.ts, --, --))
916+ >Id : Symbol(Id, Decl(indexSignatures1.ts, 311, 59))
917+
918+ type K1 = keyof Rec1; // Id
919+ >K1 : Symbol(K1, Decl(indexSignatures1.ts, 317, 31))
920+ >Rec1 : Symbol(Rec1, Decl(indexSignatures1.ts, 315, 35))
921+
922+ type K2 = keyof Rec2; // Id
923+ >K2 : Symbol(K2, Decl(indexSignatures1.ts, 319, 21))
924+ >Rec2 : Symbol(Rec2, Decl(indexSignatures1.ts, 316, 34))
925+
0 commit comments