|
| 1 | +asyncIteratorExtraParameters.ts(11,27): error TS2322: Type '{ [Symbol.asyncIterator](_: number): AsyncGenerator<number, void, unknown>; }' is not assignable to type 'AsyncIterable<T, TReturn, TNext>'. |
| 2 | + Types of property '[Symbol.asyncIterator]' are incompatible. |
| 3 | + Type '(_: number) => AsyncGenerator<number, void, unknown>' is not assignable to type '() => AsyncIterator<T, TReturn, TNext>'. |
| 4 | + Target signature provides too few arguments. Expected 1 or more, but got 0. |
| 5 | +asyncIteratorExtraParameters.ts(11,27): error TS2504: Type '{ [Symbol.asyncIterator](_: number): AsyncGenerator<number, void, unknown>; }' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. |
| 6 | +asyncIteratorExtraParameters.ts(13,12): error TS2322: Type '{ [Symbol.asyncIterator](_: number): AsyncGenerator<number, void, unknown>; }' is not assignable to type 'AsyncIterable<T, TReturn, TNext>'. |
| 7 | + Types of property '[Symbol.asyncIterator]' are incompatible. |
| 8 | + Type '(_: number) => AsyncGenerator<number, void, unknown>' is not assignable to type '() => AsyncIterator<T, TReturn, TNext>'. |
| 9 | + Target signature provides too few arguments. Expected 1 or more, but got 0. |
| 10 | +asyncIteratorExtraParameters.ts(13,12): error TS2504: Type '{ [Symbol.asyncIterator](_: number): AsyncGenerator<number, void, unknown>; }' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. |
| 11 | + |
| 12 | + |
| 13 | +==== asyncIteratorExtraParameters.ts (4 errors) ==== |
| 14 | + // https://github.com/microsoft/TypeScript/issues/57130 |
| 15 | + const iter = { |
| 16 | + async *[Symbol.asyncIterator](_: number) { |
| 17 | + yield 0; |
| 18 | + } |
| 19 | + }; |
| 20 | + |
| 21 | + declare function g(...args: any): any; |
| 22 | + |
| 23 | + async function* f() { |
| 24 | + for await (const _ of iter); |
| 25 | + ~~~~ |
| 26 | +!!! error TS2322: Type '{ [Symbol.asyncIterator](_: number): AsyncGenerator<number, void, unknown>; }' is not assignable to type 'AsyncIterable<T, TReturn, TNext>'. |
| 27 | +!!! error TS2322: Types of property '[Symbol.asyncIterator]' are incompatible. |
| 28 | +!!! error TS2322: Type '(_: number) => AsyncGenerator<number, void, unknown>' is not assignable to type '() => AsyncIterator<T, TReturn, TNext>'. |
| 29 | +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. |
| 30 | + ~~~~ |
| 31 | +!!! error TS2504: Type '{ [Symbol.asyncIterator](_: number): AsyncGenerator<number, void, unknown>; }' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. |
| 32 | + |
| 33 | + yield* iter; |
| 34 | + ~~~~ |
| 35 | +!!! error TS2322: Type '{ [Symbol.asyncIterator](_: number): AsyncGenerator<number, void, unknown>; }' is not assignable to type 'AsyncIterable<T, TReturn, TNext>'. |
| 36 | +!!! error TS2322: Types of property '[Symbol.asyncIterator]' are incompatible. |
| 37 | +!!! error TS2322: Type '(_: number) => AsyncGenerator<number, void, unknown>' is not assignable to type '() => AsyncIterator<T, TReturn, TNext>'. |
| 38 | +!!! error TS2322: Target signature provides too few arguments. Expected 1 or more, but got 0. |
| 39 | + ~~~~ |
| 40 | +!!! error TS2504: Type '{ [Symbol.asyncIterator](_: number): AsyncGenerator<number, void, unknown>; }' must have a '[Symbol.asyncIterator]()' method that returns an async iterator. |
| 41 | + } |
| 42 | + |
0 commit comments