mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
25 lines
672 B
TypeScript
25 lines
672 B
TypeScript
//// [tests/cases/conformance/es6/for-ofStatements/for-of16.ts] ////
|
|
|
|
//// [for-of16.ts]
|
|
class MyStringIterator {
|
|
[Symbol.iterator]() {
|
|
return this;
|
|
}
|
|
}
|
|
|
|
var v: string;
|
|
for (v of new MyStringIterator) { } // Should fail
|
|
|
|
for (v of new MyStringIterator) { } // Should still fail (related errors should still be shown even though type is cached).
|
|
|
|
//// [for-of16.js]
|
|
"use strict";
|
|
class MyStringIterator {
|
|
[Symbol.iterator]() {
|
|
return this;
|
|
}
|
|
}
|
|
var v;
|
|
for (v of new MyStringIterator) { } // Should fail
|
|
for (v of new MyStringIterator) { } // Should still fail (related errors should still be shown even though type is cached).
|