You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/baselines/reference/genericCallAtYieldExpressionInGenericCall1.errors.txt
+68-1Lines changed: 68 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,21 @@
1
1
genericCallAtYieldExpressionInGenericCall1.ts(26,25): error TS2488: Type '() => T' must have a '[Symbol.iterator]()' method that returns an iterator.
2
+
genericCallAtYieldExpressionInGenericCall1.ts(56,8): error TS2345: Argument of type '<T>(value: T) => Generator<number, void, any>' is not assignable to parameter of type '(value: unknown) => Generator<never, unknown, unknown>'.
3
+
Call signature return types 'Generator<number, void, any>' and 'Generator<never, unknown, unknown>' are incompatible.
4
+
The types returned by 'next(...)' are incompatible between these types.
5
+
Type 'IteratorResult<number, void>' is not assignable to type 'IteratorResult<never, unknown>'.
6
+
Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorResult<never, unknown>'.
7
+
Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorYieldResult<never>'.
8
+
Type 'number' is not assignable to type 'never'.
9
+
genericCallAtYieldExpressionInGenericCall1.ts(61,8): error TS2345: Argument of type '<T>(value: T) => Generator<number, void, any>' is not assignable to parameter of type '(value: unknown) => Generator<never, unknown, unknown>'.
10
+
Call signature return types 'Generator<number, void, any>' and 'Generator<never, unknown, unknown>' are incompatible.
11
+
The types returned by 'next(...)' are incompatible between these types.
12
+
Type 'IteratorResult<number, void>' is not assignable to type 'IteratorResult<never, unknown>'.
13
+
Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorResult<never, unknown>'.
14
+
Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorYieldResult<never>'.
declare function outer2<A, Y>(body: (value: A) => Generator<Y, any, any>): Y;
59
+
60
+
// number
61
+
const result1 = outer2(function* <T>(value: T) {
62
+
yield* inner3(value);
63
+
});
64
+
65
+
// number
66
+
const result2 = outer2(function* <T>(value: T) {
67
+
const x = inner3(value);
68
+
yield* x;
69
+
});
70
+
71
+
declare function outer3<A>(
72
+
body: (value: A) => Generator<never, unknown, unknown>,
73
+
): void;
74
+
75
+
// error
76
+
outer3(function* <T>(value: T) {
77
+
~~~~~~~~
78
+
!!! error TS2345: Argument of type '<T>(value: T) => Generator<number, void, any>' is not assignable to parameter of type '(value: unknown) => Generator<never, unknown, unknown>'.
79
+
!!! error TS2345: Call signature return types 'Generator<number, void, any>' and 'Generator<never, unknown, unknown>' are incompatible.
80
+
!!! error TS2345: The types returned by 'next(...)' are incompatible between these types.
81
+
!!! error TS2345: Type 'IteratorResult<number, void>' is not assignable to type 'IteratorResult<never, unknown>'.
82
+
!!! error TS2345: Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorResult<never, unknown>'.
83
+
!!! error TS2345: Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorYieldResult<never>'.
84
+
!!! error TS2345: Type 'number' is not assignable to type 'never'.
85
+
yield* inner3(value);
86
+
});
87
+
88
+
// error
89
+
outer3(function* <T>(value: T) {
90
+
~~~~~~~~
91
+
!!! error TS2345: Argument of type '<T>(value: T) => Generator<number, void, any>' is not assignable to parameter of type '(value: unknown) => Generator<never, unknown, unknown>'.
92
+
!!! error TS2345: Call signature return types 'Generator<number, void, any>' and 'Generator<never, unknown, unknown>' are incompatible.
93
+
!!! error TS2345: The types returned by 'next(...)' are incompatible between these types.
94
+
!!! error TS2345: Type 'IteratorResult<number, void>' is not assignable to type 'IteratorResult<never, unknown>'.
95
+
!!! error TS2345: Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorResult<never, unknown>'.
96
+
!!! error TS2345: Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorYieldResult<never>'.
97
+
!!! error TS2345: Type 'number' is not assignable to type 'never'.
0 commit comments