File: generatorYieldContextualType.types

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (38 lines) | stat: -rw-r--r-- 1,173 bytes parent folder | download | duplicates (4)
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

});