16 lines
1.2 KiB
Plaintext
16 lines
1.2 KiB
Plaintext
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck8.ts(2,17): error TS2322: Type 'IterableIterator<string>' is not assignable to type 'BadGenerator'.
|
|
Types of property 'next' are incompatible.
|
|
Type '(value?: any) => IteratorResult<string>' is not assignable to type '(value?: any) => IteratorResult<number>'.
|
|
Type 'IteratorResult<string>' is not assignable to type 'IteratorResult<number>'.
|
|
Type 'string' is not assignable to type 'number'.
|
|
|
|
|
|
==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck8.ts (1 errors) ====
|
|
interface BadGenerator extends Iterator<number>, Iterable<string> { }
|
|
function* g3(): BadGenerator { }
|
|
~~~~~~~~~~~~
|
|
!!! error TS2322: Type 'IterableIterator<string>' is not assignable to type 'BadGenerator'.
|
|
!!! error TS2322: Types of property 'next' are incompatible.
|
|
!!! error TS2322: Type '(value?: any) => IteratorResult<string>' is not assignable to type '(value?: any) => IteratorResult<number>'.
|
|
!!! error TS2322: Type 'IteratorResult<string>' is not assignable to type 'IteratorResult<number>'.
|
|
!!! error TS2322: Type 'string' is not assignable to type 'number'. |