@@ -407,3 +407,77 @@ passContentsToFunc(outerBoxOfString, box => box.value);
407
407
>box : Symbol(box, Decl(instantiateContextualTypes.ts, 138, 36))
408
408
>value : Symbol(value, Decl(instantiateContextualTypes.ts, 121, 20))
409
409
410
+ // Repro from #32349
411
+
412
+ type DooDad = 'SOMETHING' | 'ELSE' ;
413
+ >DooDad : Symbol(DooDad, Decl(instantiateContextualTypes.ts, 138, 55))
414
+
415
+ class Interesting {
416
+ >Interesting : Symbol(Interesting, Decl(instantiateContextualTypes.ts, 142, 36))
417
+
418
+ public compiles = () : Promise<DooDad> => {
419
+ >compiles : Symbol(Interesting.compiles, Decl(instantiateContextualTypes.ts, 144, 19))
420
+ >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, --, --))
421
+ >DooDad : Symbol(DooDad, Decl(instantiateContextualTypes.ts, 138, 55))
422
+
423
+ return Promise.resolve().then(() => {
424
+ >Promise.resolve().then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
425
+ >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
426
+ >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, --, --))
427
+ >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
428
+ >then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
429
+
430
+ if (1 < 2) {
431
+ return 'SOMETHING';
432
+ }
433
+ return 'ELSE';
434
+ });
435
+ };
436
+ public doesnt = () : Promise<DooDad> => {
437
+ >doesnt : Symbol(Interesting.doesnt, Decl(instantiateContextualTypes.ts, 152, 3))
438
+ >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, --, --))
439
+ >DooDad : Symbol(DooDad, Decl(instantiateContextualTypes.ts, 138, 55))
440
+
441
+ return Promise.resolve().then(() => {
442
+ >Promise.resolve().then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
443
+ >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
444
+ >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, --, --))
445
+ >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
446
+ >then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
447
+
448
+ return 'ELSE';
449
+ });
450
+ };
451
+ public slightlyDifferentErrorMessage = () : Promise<DooDad> => {
452
+ >slightlyDifferentErrorMessage : Symbol(Interesting.slightlyDifferentErrorMessage, Decl(instantiateContextualTypes.ts, 157, 3))
453
+ >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, --, --))
454
+ >DooDad : Symbol(DooDad, Decl(instantiateContextualTypes.ts, 138, 55))
455
+
456
+ return Promise.resolve().then(() => {
457
+ >Promise.resolve().then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
458
+ >Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
459
+ >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, --, --))
460
+ >resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --))
461
+ >then : Symbol(Promise.then, Decl(lib.es5.d.ts, --, --))
462
+
463
+ if (1 < 2) {
464
+ return 'SOMETHING';
465
+ }
466
+ return 'SOMETHING';
467
+ });
468
+ };
469
+ }
470
+
471
+ // Repro from #32349
472
+
473
+ declare function invoke<T>(f: () => T): T;
474
+ >invoke : Symbol(invoke, Decl(instantiateContextualTypes.ts, 166, 1))
475
+ >T : Symbol(T, Decl(instantiateContextualTypes.ts, 170, 24))
476
+ >f : Symbol(f, Decl(instantiateContextualTypes.ts, 170, 27))
477
+ >T : Symbol(T, Decl(instantiateContextualTypes.ts, 170, 24))
478
+ >T : Symbol(T, Decl(instantiateContextualTypes.ts, 170, 24))
479
+
480
+ let xx: 0 | 1 | 2 = invoke(() => 1);
481
+ >xx : Symbol(xx, Decl(instantiateContextualTypes.ts, 172, 3))
482
+ >invoke : Symbol(invoke, Decl(instantiateContextualTypes.ts, 166, 1))
483
+
0 commit comments