@@ -1699,83 +1699,110 @@ function addToMyThingy<S extends KeyTypes>(key: S) {
16991699>push : Symbol(Array.push, Decl(lib.d.ts, --, --))
17001700}
17011701
1702+ // Repro from #13102
1703+
1704+ type Handler<T> = {
1705+ >Handler : Symbol(Handler, Decl(keyofAndIndexedAccess.ts, 463, 1))
1706+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 467, 13))
1707+
1708+ onChange: (name: keyof T) => void;
1709+ >onChange : Symbol(onChange, Decl(keyofAndIndexedAccess.ts, 467, 19))
1710+ >name : Symbol(name, Decl(keyofAndIndexedAccess.ts, 468, 15))
1711+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 467, 13))
1712+
1713+ };
1714+
1715+ function onChangeGenericFunction<T>(handler: Handler<T & {preset: number}>) {
1716+ >onChangeGenericFunction : Symbol(onChangeGenericFunction, Decl(keyofAndIndexedAccess.ts, 469, 2))
1717+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 471, 33))
1718+ >handler : Symbol(handler, Decl(keyofAndIndexedAccess.ts, 471, 36))
1719+ >Handler : Symbol(Handler, Decl(keyofAndIndexedAccess.ts, 463, 1))
1720+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 471, 33))
1721+ >preset : Symbol(preset, Decl(keyofAndIndexedAccess.ts, 471, 58))
1722+
1723+ handler.onChange('preset')
1724+ >handler.onChange : Symbol(onChange, Decl(keyofAndIndexedAccess.ts, 467, 19))
1725+ >handler : Symbol(handler, Decl(keyofAndIndexedAccess.ts, 471, 36))
1726+ >onChange : Symbol(onChange, Decl(keyofAndIndexedAccess.ts, 467, 19))
1727+ }
1728+
17021729// Repro from #13285
17031730
17041731function updateIds<T extends Record<K, string>, K extends string>(
1705- >updateIds : Symbol(updateIds, Decl(keyofAndIndexedAccess.ts, 463 , 1))
1706- >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 467 , 19))
1732+ >updateIds : Symbol(updateIds, Decl(keyofAndIndexedAccess.ts, 473 , 1))
1733+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 477 , 19))
17071734>Record : Symbol(Record, Decl(lib.d.ts, --, --))
1708- >K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 467 , 47))
1709- >K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 467 , 47))
1735+ >K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 477 , 47))
1736+ >K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 477 , 47))
17101737
17111738 obj: T,
1712- >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 467 , 66))
1713- >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 467 , 19))
1739+ >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 477 , 66))
1740+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 477 , 19))
17141741
17151742 idFields: K[],
1716- >idFields : Symbol(idFields, Decl(keyofAndIndexedAccess.ts, 468 , 11))
1717- >K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 467 , 47))
1743+ >idFields : Symbol(idFields, Decl(keyofAndIndexedAccess.ts, 478 , 11))
1744+ >K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 477 , 47))
17181745
17191746 idMapping: { [oldId: string]: string }
1720- >idMapping : Symbol(idMapping, Decl(keyofAndIndexedAccess.ts, 469 , 18))
1721- >oldId : Symbol(oldId, Decl(keyofAndIndexedAccess.ts, 470 , 18))
1747+ >idMapping : Symbol(idMapping, Decl(keyofAndIndexedAccess.ts, 479 , 18))
1748+ >oldId : Symbol(oldId, Decl(keyofAndIndexedAccess.ts, 480 , 18))
17221749
17231750): Record<K, string> {
17241751>Record : Symbol(Record, Decl(lib.d.ts, --, --))
1725- >K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 467 , 47))
1752+ >K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 477 , 47))
17261753
17271754 for (const idField of idFields) {
1728- >idField : Symbol(idField, Decl(keyofAndIndexedAccess.ts, 472 , 14))
1729- >idFields : Symbol(idFields, Decl(keyofAndIndexedAccess.ts, 468 , 11))
1755+ >idField : Symbol(idField, Decl(keyofAndIndexedAccess.ts, 482 , 14))
1756+ >idFields : Symbol(idFields, Decl(keyofAndIndexedAccess.ts, 478 , 11))
17301757
17311758 const newId = idMapping[obj[idField]];
1732- >newId : Symbol(newId, Decl(keyofAndIndexedAccess.ts, 473 , 13))
1733- >idMapping : Symbol(idMapping, Decl(keyofAndIndexedAccess.ts, 469 , 18))
1734- >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 467 , 66))
1735- >idField : Symbol(idField, Decl(keyofAndIndexedAccess.ts, 472 , 14))
1759+ >newId : Symbol(newId, Decl(keyofAndIndexedAccess.ts, 483 , 13))
1760+ >idMapping : Symbol(idMapping, Decl(keyofAndIndexedAccess.ts, 479 , 18))
1761+ >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 477 , 66))
1762+ >idField : Symbol(idField, Decl(keyofAndIndexedAccess.ts, 482 , 14))
17361763
17371764 if (newId) {
1738- >newId : Symbol(newId, Decl(keyofAndIndexedAccess.ts, 473 , 13))
1765+ >newId : Symbol(newId, Decl(keyofAndIndexedAccess.ts, 483 , 13))
17391766
17401767 obj[idField] = newId;
1741- >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 467 , 66))
1742- >idField : Symbol(idField, Decl(keyofAndIndexedAccess.ts, 472 , 14))
1743- >newId : Symbol(newId, Decl(keyofAndIndexedAccess.ts, 473 , 13))
1768+ >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 477 , 66))
1769+ >idField : Symbol(idField, Decl(keyofAndIndexedAccess.ts, 482 , 14))
1770+ >newId : Symbol(newId, Decl(keyofAndIndexedAccess.ts, 483 , 13))
17441771 }
17451772 }
17461773 return obj;
1747- >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 467 , 66))
1774+ >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 477 , 66))
17481775}
17491776
17501777// Repro from #13285
17511778
17521779function updateIds2<T extends { [x: string]: string }, K extends keyof T>(
1753- >updateIds2 : Symbol(updateIds2, Decl(keyofAndIndexedAccess.ts, 479 , 1))
1754- >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 483 , 20))
1755- >x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 483 , 33))
1756- >K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 483 , 54))
1757- >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 483 , 20))
1780+ >updateIds2 : Symbol(updateIds2, Decl(keyofAndIndexedAccess.ts, 489 , 1))
1781+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 493 , 20))
1782+ >x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 493 , 33))
1783+ >K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 493 , 54))
1784+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 493 , 20))
17581785
17591786 obj: T,
1760- >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 483 , 74))
1761- >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 483 , 20))
1787+ >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 493 , 74))
1788+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 493 , 20))
17621789
17631790 key: K,
1764- >key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 484 , 11))
1765- >K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 483 , 54))
1791+ >key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 494 , 11))
1792+ >K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 493 , 54))
17661793
17671794 stringMap: { [oldId: string]: string }
1768- >stringMap : Symbol(stringMap, Decl(keyofAndIndexedAccess.ts, 485 , 11))
1769- >oldId : Symbol(oldId, Decl(keyofAndIndexedAccess.ts, 486 , 18))
1795+ >stringMap : Symbol(stringMap, Decl(keyofAndIndexedAccess.ts, 495 , 11))
1796+ >oldId : Symbol(oldId, Decl(keyofAndIndexedAccess.ts, 496 , 18))
17701797
17711798) {
17721799 var x = obj[key];
1773- >x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 488 , 7))
1774- >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 483 , 74))
1775- >key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 484 , 11))
1800+ >x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 498 , 7))
1801+ >obj : Symbol(obj, Decl(keyofAndIndexedAccess.ts, 493 , 74))
1802+ >key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 494 , 11))
17761803
17771804 stringMap[x]; // Should be OK.
1778- >stringMap : Symbol(stringMap, Decl(keyofAndIndexedAccess.ts, 485 , 11))
1779- >x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 488 , 7))
1805+ >stringMap : Symbol(stringMap, Decl(keyofAndIndexedAccess.ts, 495 , 11))
1806+ >x : Symbol(x, Decl(keyofAndIndexedAccess.ts, 498 , 7))
17801807}
17811808
0 commit comments