20 lines
No EOL
599 B
Text
20 lines
No EOL
599 B
Text
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;
|
|
}
|
|
} |