@@ -2258,3 +2258,64 @@ declare function f7<K extends keyof I7>(type: K): Foo7<I7[K]>;
22582258>I7 : Symbol(I7, Decl(keyofAndIndexedAccess.ts, 627, 1))
22592259>K : Symbol(K, Decl(keyofAndIndexedAccess.ts, 635, 20))
22602260
2261+ // Repro from #21770
2262+
2263+ type Dict<T extends string> = { [key in T]: number };
2264+ >Dict : Symbol(Dict, Decl(keyofAndIndexedAccess.ts, 635, 62))
2265+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 639, 10))
2266+ >key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 639, 33))
2267+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 639, 10))
2268+
2269+ type DictDict<V extends string, T extends string> = { [key in V]: Dict<T> };
2270+ >DictDict : Symbol(DictDict, Decl(keyofAndIndexedAccess.ts, 639, 53))
2271+ >V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 640, 14))
2272+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 640, 31))
2273+ >key : Symbol(key, Decl(keyofAndIndexedAccess.ts, 640, 55))
2274+ >V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 640, 14))
2275+ >Dict : Symbol(Dict, Decl(keyofAndIndexedAccess.ts, 635, 62))
2276+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 640, 31))
2277+
2278+ function ff1<V extends string, T extends string>(dd: DictDict<V, T>, k1: V, k2: T): number {
2279+ >ff1 : Symbol(ff1, Decl(keyofAndIndexedAccess.ts, 640, 76))
2280+ >V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 642, 13))
2281+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 642, 30))
2282+ >dd : Symbol(dd, Decl(keyofAndIndexedAccess.ts, 642, 49))
2283+ >DictDict : Symbol(DictDict, Decl(keyofAndIndexedAccess.ts, 639, 53))
2284+ >V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 642, 13))
2285+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 642, 30))
2286+ >k1 : Symbol(k1, Decl(keyofAndIndexedAccess.ts, 642, 68))
2287+ >V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 642, 13))
2288+ >k2 : Symbol(k2, Decl(keyofAndIndexedAccess.ts, 642, 75))
2289+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 642, 30))
2290+
2291+ return dd[k1][k2];
2292+ >dd : Symbol(dd, Decl(keyofAndIndexedAccess.ts, 642, 49))
2293+ >k1 : Symbol(k1, Decl(keyofAndIndexedAccess.ts, 642, 68))
2294+ >k2 : Symbol(k2, Decl(keyofAndIndexedAccess.ts, 642, 75))
2295+ }
2296+
2297+ function ff2<V extends string, T extends string>(dd: DictDict<V, T>, k1: V, k2: T): number {
2298+ >ff2 : Symbol(ff2, Decl(keyofAndIndexedAccess.ts, 644, 1))
2299+ >V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 646, 13))
2300+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 646, 30))
2301+ >dd : Symbol(dd, Decl(keyofAndIndexedAccess.ts, 646, 49))
2302+ >DictDict : Symbol(DictDict, Decl(keyofAndIndexedAccess.ts, 639, 53))
2303+ >V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 646, 13))
2304+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 646, 30))
2305+ >k1 : Symbol(k1, Decl(keyofAndIndexedAccess.ts, 646, 68))
2306+ >V : Symbol(V, Decl(keyofAndIndexedAccess.ts, 646, 13))
2307+ >k2 : Symbol(k2, Decl(keyofAndIndexedAccess.ts, 646, 75))
2308+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 646, 30))
2309+
2310+ const d: Dict<T> = dd[k1];
2311+ >d : Symbol(d, Decl(keyofAndIndexedAccess.ts, 647, 9))
2312+ >Dict : Symbol(Dict, Decl(keyofAndIndexedAccess.ts, 635, 62))
2313+ >T : Symbol(T, Decl(keyofAndIndexedAccess.ts, 646, 30))
2314+ >dd : Symbol(dd, Decl(keyofAndIndexedAccess.ts, 646, 49))
2315+ >k1 : Symbol(k1, Decl(keyofAndIndexedAccess.ts, 646, 68))
2316+
2317+ return d[k2];
2318+ >d : Symbol(d, Decl(keyofAndIndexedAccess.ts, 647, 9))
2319+ >k2 : Symbol(k2, Decl(keyofAndIndexedAccess.ts, 646, 75))
2320+ }
2321+
0 commit comments