TypeScript/tests/baselines/reference/for-of14.errors.txt

14 lines
562 B
Plaintext
Raw Normal View History

tests/cases/conformance/es6/for-ofStatements/for-of14.ts(2,11): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator.
2015-02-24 04:07:45 +01:00
==== tests/cases/conformance/es6/for-ofStatements/for-of14.ts (1 errors) ====
var v: string;
for (v of new StringIterator) { } // Should fail because the iterator is not iterable
~~~~~~~~~~~~~~~~~~
!!! error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator.
2015-02-24 04:07:45 +01:00
class StringIterator {
next() {
return "";
}
}