20 lines
599 B
Plaintext
20 lines
599 B
Plaintext
|
tests/cases/conformance/es6/for-ofStatements/for-of17.ts(2,6): error TS2322: Type 'number' is not assignable to type 'string'.
|
||
|
|
||
|
|
||
|
==== tests/cases/conformance/es6/for-ofStatements/for-of17.ts (1 errors) ====
|
||
|
var v: string;
|
||
|
for (v of new NumberIterator) { } // Should succeed
|
||
|
~
|
||
|
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
||
|
|
||
|
class NumberIterator {
|
||
|
next() {
|
||
|
return {
|
||
|
value: 0,
|
||
|
done: false
|
||
|
};
|
||
|
}
|
||
|
[Symbol.iterator]() {
|
||
|
return this;
|
||
|
}
|
||
|
}
|