@@ -433,3 +433,34 @@ async function f17_usage() {
433
433
return { x };
434
434
>x : Symbol(x, Decl(awaitedType.ts, 169, 12))
435
435
}
436
+
437
+ // https://github.com/microsoft/TypeScript/issues/47144
438
+ type GenericStructure<
439
+ >GenericStructure : Symbol(GenericStructure, Decl(awaitedType.ts, 170, 1))
440
+
441
+ AcceptableKeyType extends string = string
442
+ >AcceptableKeyType : Symbol(AcceptableKeyType, Decl(awaitedType.ts, 173, 22))
443
+
444
+ > = Record<AcceptableKeyType, number>;
445
+ >Record : Symbol(Record, Decl(lib.es5.d.ts, --, --))
446
+ >AcceptableKeyType : Symbol(AcceptableKeyType, Decl(awaitedType.ts, 173, 22))
447
+
448
+ async function brokenExample<AcceptableKeyType extends string = string>(structurePromise: Promise<GenericStructure<AcceptableKeyType>>, key: AcceptableKeyType): Promise<void> {
449
+ >brokenExample : Symbol(brokenExample, Decl(awaitedType.ts, 175, 38))
450
+ >AcceptableKeyType : Symbol(AcceptableKeyType, Decl(awaitedType.ts, 177, 29))
451
+ >structurePromise : Symbol(structurePromise, Decl(awaitedType.ts, 177, 72))
452
+ >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --))
453
+ >GenericStructure : Symbol(GenericStructure, Decl(awaitedType.ts, 170, 1))
454
+ >AcceptableKeyType : Symbol(AcceptableKeyType, Decl(awaitedType.ts, 177, 29))
455
+ >key : Symbol(key, Decl(awaitedType.ts, 177, 135))
456
+ >AcceptableKeyType : Symbol(AcceptableKeyType, Decl(awaitedType.ts, 177, 29))
457
+ >Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2018.promise.d.ts, --, --))
458
+
459
+ const structure = await structurePromise;
460
+ >structure : Symbol(structure, Decl(awaitedType.ts, 178, 7))
461
+ >structurePromise : Symbol(structurePromise, Decl(awaitedType.ts, 177, 72))
462
+
463
+ structure[key] = 1;
464
+ >structure : Symbol(structure, Decl(awaitedType.ts, 178, 7))
465
+ >key : Symbol(key, Decl(awaitedType.ts, 177, 135))
466
+ }
0 commit comments