|
| 1 | +//// [tests/cases/compiler/contextualParamTypeVsNestedReturnTypeInference1.ts] //// |
| 2 | + |
| 3 | +=== contextualParamTypeVsNestedReturnTypeInference1.ts === |
| 4 | +interface Effect<A> { |
| 5 | +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 0, 0)) |
| 6 | +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 0, 17)) |
| 7 | + |
| 8 | + _A: A; |
| 9 | +>_A : Symbol(Effect._A, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 0, 21)) |
| 10 | +>A : Symbol(A, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 0, 17)) |
| 11 | +} |
| 12 | + |
| 13 | +declare function effectGen<AEff>(f: () => AEff): Effect<AEff>; |
| 14 | +>effectGen : Symbol(effectGen, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 2, 1)) |
| 15 | +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 4, 27)) |
| 16 | +>f : Symbol(f, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 4, 33)) |
| 17 | +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 4, 27)) |
| 18 | +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 0, 0)) |
| 19 | +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 4, 27)) |
| 20 | + |
| 21 | +declare function effectFn<AEff, Args extends Array<any>>( |
| 22 | +>effectFn : Symbol(effectFn, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 4, 62)) |
| 23 | +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 6, 26)) |
| 24 | +>Args : Symbol(Args, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 6, 31)) |
| 25 | +>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --) ... and 4 more) |
| 26 | + |
| 27 | + body: (...args: Args) => unknown, |
| 28 | +>body : Symbol(body, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 6, 57)) |
| 29 | +>args : Symbol(args, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 7, 9)) |
| 30 | +>Args : Symbol(Args, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 6, 31)) |
| 31 | + |
| 32 | +): (...args: Args) => Effect<AEff>; |
| 33 | +>args : Symbol(args, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 8, 4)) |
| 34 | +>Args : Symbol(Args, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 6, 31)) |
| 35 | +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 0, 0)) |
| 36 | +>AEff : Symbol(AEff, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 6, 26)) |
| 37 | + |
| 38 | +declare function layerEffect<S>(tag: Tag<S>, effect: Effect<S>): unknown; |
| 39 | +>layerEffect : Symbol(layerEffect, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 8, 35)) |
| 40 | +>S : Symbol(S, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 10, 29)) |
| 41 | +>tag : Symbol(tag, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 10, 32)) |
| 42 | +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 10, 73)) |
| 43 | +>S : Symbol(S, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 10, 29)) |
| 44 | +>effect : Symbol(effect, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 10, 44)) |
| 45 | +>Effect : Symbol(Effect, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 0, 0)) |
| 46 | +>S : Symbol(S, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 10, 29)) |
| 47 | + |
| 48 | +interface Tag<Type> { |
| 49 | +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 10, 73)) |
| 50 | +>Type : Symbol(Type, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 12, 14)) |
| 51 | + |
| 52 | + _Type: Type; |
| 53 | +>_Type : Symbol(Tag._Type, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 12, 21)) |
| 54 | +>Type : Symbol(Type, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 12, 14)) |
| 55 | +} |
| 56 | + |
| 57 | +declare const Foo: Tag<{ |
| 58 | +>Foo : Symbol(Foo, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 16, 13)) |
| 59 | +>Tag : Symbol(Tag, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 10, 73)) |
| 60 | + |
| 61 | + fn: (a: string) => unknown; |
| 62 | +>fn : Symbol(fn, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 16, 24)) |
| 63 | +>a : Symbol(a, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 17, 7)) |
| 64 | + |
| 65 | +}>; |
| 66 | + |
| 67 | +layerEffect( |
| 68 | +>layerEffect : Symbol(layerEffect, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 8, 35)) |
| 69 | + |
| 70 | + Foo, |
| 71 | +>Foo : Symbol(Foo, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 16, 13)) |
| 72 | + |
| 73 | + effectGen(function () { |
| 74 | +>effectGen : Symbol(effectGen, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 2, 1)) |
| 75 | + |
| 76 | + return { |
| 77 | + fn: effectFn(function (a) { |
| 78 | +>fn : Symbol(fn, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 23, 12)) |
| 79 | +>effectFn : Symbol(effectFn, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 4, 62)) |
| 80 | +>a : Symbol(a, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 24, 29)) |
| 81 | + |
| 82 | + a; // string |
| 83 | +>a : Symbol(a, Decl(contextualParamTypeVsNestedReturnTypeInference1.ts, 24, 29)) |
| 84 | + |
| 85 | + }), |
| 86 | + }; |
| 87 | + }), |
| 88 | +); |
| 89 | + |
0 commit comments