|
| 1 | +//// [tests/cases/compiler/genericCallAtYieldExpressionInGenericCall3.ts] //// |
| 2 | + |
| 3 | +=== genericCallAtYieldExpressionInGenericCall3.ts === |
| 4 | +type ReadonlyRecord<in out K extends string | symbol, out A> = { |
| 5 | +>ReadonlyRecord : Symbol(ReadonlyRecord, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 0, 0)) |
| 6 | +>K : Symbol(K, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 0, 20)) |
| 7 | +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 0, 53)) |
| 8 | + |
| 9 | + readonly [P in K]: A; |
| 10 | +>P : Symbol(P, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 1, 12)) |
| 11 | +>K : Symbol(K, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 0, 20)) |
| 12 | +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 0, 53)) |
| 13 | + |
| 14 | +}; |
| 15 | + |
| 16 | +type Success<T> = T extends Micro<infer _A, infer _E, infer _R> ? _A : never; |
| 17 | +>Success : Symbol(Success, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 2, 2)) |
| 18 | +>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 4, 13)) |
| 19 | +>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 4, 13)) |
| 20 | +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) |
| 21 | +>_A : Symbol(_A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 4, 39)) |
| 22 | +>_E : Symbol(_E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 4, 49)) |
| 23 | +>_R : Symbol(_R, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 4, 59)) |
| 24 | +>_A : Symbol(_A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 4, 39)) |
| 25 | + |
| 26 | +interface MicroIterator<T extends Micro<any, any, any>> { |
| 27 | +>MicroIterator : Symbol(MicroIterator, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 4, 77)) |
| 28 | +>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 6, 24)) |
| 29 | +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) |
| 30 | + |
| 31 | + next(...args: ReadonlyArray<any>): IteratorResult<T, Success<T>>; |
| 32 | +>next : Symbol(MicroIterator.next, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 6, 57)) |
| 33 | +>args : Symbol(args, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 7, 7)) |
| 34 | +>ReadonlyArray : Symbol(ReadonlyArray, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2016.array.include.d.ts, --, --) ... and 3 more) |
| 35 | +>IteratorResult : Symbol(IteratorResult, Decl(lib.es2015.iterable.d.ts, --, --)) |
| 36 | +>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 6, 24)) |
| 37 | +>Success : Symbol(Success, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 2, 2)) |
| 38 | +>T : Symbol(T, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 6, 24)) |
| 39 | +} |
| 40 | + |
| 41 | +interface Micro<out A, out E = never, out R = never> { |
| 42 | +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) |
| 43 | +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 16)) |
| 44 | +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 22)) |
| 45 | +>R : Symbol(R, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 37)) |
| 46 | + |
| 47 | + _A: A; |
| 48 | +>_A : Symbol(Micro._A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 54)) |
| 49 | +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 16)) |
| 50 | + |
| 51 | + _E: E; |
| 52 | +>_E : Symbol(Micro._E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 11, 8)) |
| 53 | +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 22)) |
| 54 | + |
| 55 | + _R: R; |
| 56 | +>_R : Symbol(Micro._R, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 12, 8)) |
| 57 | +>R : Symbol(R, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 37)) |
| 58 | + |
| 59 | + [Symbol.iterator](): MicroIterator<Micro<A, E, R>>; |
| 60 | +>[Symbol.iterator] : Symbol(Micro[Symbol.iterator], Decl(genericCallAtYieldExpressionInGenericCall3.ts, 13, 8)) |
| 61 | +>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) |
| 62 | +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --)) |
| 63 | +>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --)) |
| 64 | +>MicroIterator : Symbol(MicroIterator, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 4, 77)) |
| 65 | +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) |
| 66 | +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 16)) |
| 67 | +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 22)) |
| 68 | +>R : Symbol(R, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 10, 37)) |
| 69 | +} |
| 70 | + |
| 71 | +declare function runPromise<A, E>(effect: Micro<A, E>): Promise<A>; |
| 72 | +>runPromise : Symbol(runPromise, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 15, 1)) |
| 73 | +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 17, 28)) |
| 74 | +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 17, 30)) |
| 75 | +>effect : Symbol(effect, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 17, 34)) |
| 76 | +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) |
| 77 | +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 17, 28)) |
| 78 | +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 17, 30)) |
| 79 | +>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, --, --)) |
| 80 | +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 17, 28)) |
| 81 | + |
| 82 | +declare function gen<Eff extends Micro<any, any, any>, AEff>( |
| 83 | +>gen : Symbol(gen, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 17, 67)) |
| 84 | +>Eff : Symbol(Eff, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 19, 21)) |
| 85 | +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) |
| 86 | +>AEff : Symbol(AEff, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 19, 54)) |
| 87 | + |
| 88 | + body: () => Generator<Eff, AEff, never>, |
| 89 | +>body : Symbol(body, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 19, 61)) |
| 90 | +>Generator : Symbol(Generator, Decl(lib.es2015.generator.d.ts, --, --)) |
| 91 | +>Eff : Symbol(Eff, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 19, 21)) |
| 92 | +>AEff : Symbol(AEff, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 19, 54)) |
| 93 | + |
| 94 | +): Micro<AEff, any, never>; |
| 95 | +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) |
| 96 | +>AEff : Symbol(AEff, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 19, 54)) |
| 97 | + |
| 98 | +declare const traverse: { |
| 99 | +>traverse : Symbol(traverse, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 23, 13)) |
| 100 | + |
| 101 | + <A, R, O, E, B>( |
| 102 | +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 3)) |
| 103 | +>R : Symbol(R, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 5)) |
| 104 | +>O : Symbol(O, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 8)) |
| 105 | +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 11)) |
| 106 | +>B : Symbol(B, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 14)) |
| 107 | + |
| 108 | + f: (a: A) => Micro<B, E, O>, |
| 109 | +>f : Symbol(f, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 18)) |
| 110 | +>a : Symbol(a, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 25, 8)) |
| 111 | +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 3)) |
| 112 | +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) |
| 113 | +>B : Symbol(B, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 14)) |
| 114 | +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 11)) |
| 115 | +>O : Symbol(O, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 8)) |
| 116 | + |
| 117 | + ): ( |
| 118 | + self: ReadonlyRecord<string, A>, |
| 119 | +>self : Symbol(self, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 26, 6)) |
| 120 | +>ReadonlyRecord : Symbol(ReadonlyRecord, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 0, 0)) |
| 121 | +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 3)) |
| 122 | + |
| 123 | + ) => Micro<ReadonlyRecord<string, B>, E, O>; |
| 124 | +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) |
| 125 | +>ReadonlyRecord : Symbol(ReadonlyRecord, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 0, 0)) |
| 126 | +>B : Symbol(B, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 14)) |
| 127 | +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 11)) |
| 128 | +>O : Symbol(O, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 24, 8)) |
| 129 | + |
| 130 | + <A, O, E, B>( |
| 131 | +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 3)) |
| 132 | +>O : Symbol(O, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 5)) |
| 133 | +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 8)) |
| 134 | +>B : Symbol(B, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 11)) |
| 135 | + |
| 136 | + self: ReadonlyRecord<string, A>, |
| 137 | +>self : Symbol(self, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 15)) |
| 138 | +>ReadonlyRecord : Symbol(ReadonlyRecord, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 0, 0)) |
| 139 | +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 3)) |
| 140 | + |
| 141 | + f: (a: A) => Micro<B, E, O>, |
| 142 | +>f : Symbol(f, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 30, 36)) |
| 143 | +>a : Symbol(a, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 31, 8)) |
| 144 | +>A : Symbol(A, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 3)) |
| 145 | +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) |
| 146 | +>B : Symbol(B, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 11)) |
| 147 | +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 8)) |
| 148 | +>O : Symbol(O, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 5)) |
| 149 | + |
| 150 | + ): Micro<ReadonlyRecord<string, B>, E, O>; |
| 151 | +>Micro : Symbol(Micro, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 8, 1)) |
| 152 | +>ReadonlyRecord : Symbol(ReadonlyRecord, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 0, 0)) |
| 153 | +>B : Symbol(B, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 11)) |
| 154 | +>E : Symbol(E, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 8)) |
| 155 | +>O : Symbol(O, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 29, 5)) |
| 156 | + |
| 157 | +}; |
| 158 | + |
| 159 | +runPromise( |
| 160 | +>runPromise : Symbol(runPromise, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 15, 1)) |
| 161 | + |
| 162 | + gen(function* () { |
| 163 | +>gen : Symbol(gen, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 17, 67)) |
| 164 | + |
| 165 | + yield* traverse({ a: 1, b: 2 }, (n) => |
| 166 | +>traverse : Symbol(traverse, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 23, 13)) |
| 167 | +>a : Symbol(a, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 37, 21)) |
| 168 | +>b : Symbol(b, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 37, 27)) |
| 169 | +>n : Symbol(n, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 37, 37)) |
| 170 | + |
| 171 | + gen(function* () { |
| 172 | +>gen : Symbol(gen, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 17, 67)) |
| 173 | + |
| 174 | + return n + 1; |
| 175 | +>n : Symbol(n, Decl(genericCallAtYieldExpressionInGenericCall3.ts, 37, 37)) |
| 176 | + |
| 177 | + }), |
| 178 | + ); |
| 179 | + }), |
| 180 | +); |
| 181 | + |
0 commit comments