1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
=== tests/cases/conformance/generators/generatorYieldContextualType.ts ===
declare function f1<T, R, S>(gen: () => Generator<R, T, S>): void;
>f1 : <T, R, S>(gen: () => Generator<R, T, S>) => void
>gen : () => Generator<R, T, S>
f1<0, 0, 1>(function* () {
>f1<0, 0, 1>(function* () { const a = yield 0; return 0;}) : void
>f1 : <T, R, S>(gen: () => Generator<R, T, S>) => void
>function* () { const a = yield 0; return 0;} : () => Generator<0, 0, 1>
const a = yield 0;
>a : 1
>yield 0 : 1
>0 : 0
return 0;
>0 : 0
});
declare function f2<T, R, S>(gen: () => Generator<R, T, S> | AsyncGenerator<R, T, S>): void;
>f2 : <T, R, S>(gen: () => Generator<R, T, S> | AsyncGenerator<R, T, S>) => void
>gen : () => Generator<R, T, S> | AsyncGenerator<R, T, S>
f2<0, 0, 1>(async function* () {
>f2<0, 0, 1>(async function* () { const a = yield 0; return 0;}) : void
>f2 : <T, R, S>(gen: () => Generator<R, T, S> | AsyncGenerator<R, T, S>) => void
>async function* () { const a = yield 0; return 0;} : () => AsyncGenerator<0, 0, 1 | undefined>
const a = yield 0;
>a : 1 | undefined
>yield 0 : 1 | undefined
>0 : 0
return 0;
>0 : 0
});
|