Update tests and baselines to declare class declaration before use

This commit is contained in:
Kanchalai Tanglertsampan
2017-02-24 17:48:06 -08:00
parent d511884cd9
commit 1415cf4ea2
223 changed files with 1628 additions and 1561 deletions
@@ -1,11 +1,8 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(1,15): error TS2495: Type 'StringIterator' is not an array type or a string type.
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(11,6): error TS2304: Cannot find name 'Symbol'.
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(10,6): error TS2304: Cannot find name 'Symbol'.
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(15,15): error TS2495: Type 'StringIterator' is not an array type or a string type.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts (2 errors) ====
for (var v of new StringIterator) { }
~~~~~~~~~~~~~~~~~~
!!! error TS2495: Type 'StringIterator' is not an array type or a string type.
// In ES3/5, you cannot for...of over an arbitrary iterable.
class StringIterator {
@@ -20,4 +17,8 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck10.ts(11,6
!!! error TS2304: Cannot find name 'Symbol'.
return this;
}
}
}
for (var v of new StringIterator) { }
~~~~~~~~~~~~~~~~~~
!!! error TS2495: Type 'StringIterator' is not an array type or a string type.
@@ -1,5 +1,4 @@
//// [ES5For-ofTypeCheck10.ts]
for (var v of new StringIterator) { }
// In ES3/5, you cannot for...of over an arbitrary iterable.
class StringIterator {
@@ -12,12 +11,11 @@ class StringIterator {
[Symbol.iterator]() {
return this;
}
}
}
for (var v of new StringIterator) { }
//// [ES5For-ofTypeCheck10.js]
for (var _i = 0, _a = new StringIterator; _i < _a.length; _i++) {
var v = _a[_i];
}
// In ES3/5, you cannot for...of over an arbitrary iterable.
var StringIterator = (function () {
function StringIterator() {
@@ -33,3 +31,6 @@ var StringIterator = (function () {
};
return StringIterator;
}());
for (var _i = 0, _a = new StringIterator; _i < _a.length; _i++) {
var v = _a[_i];
}
@@ -1,16 +1,16 @@
//// [classDoesNotDependOnBaseTypes.ts]
var x: StringTree;
if (typeof x !== "string") {
x[0] = "";
x[0] = new StringTreeCollection;
}
type StringTree = string | StringTreeCollection;
class StringTreeCollectionBase {
[n: number]: StringTree;
}
class StringTreeCollection extends StringTreeCollectionBase { }
class StringTreeCollection extends StringTreeCollectionBase { }
var x: StringTree;
if (typeof x !== "string") {
x[0] = "";
x[0] = new StringTreeCollection;
}
//// [classDoesNotDependOnBaseTypes.js]
var __extends = (this && this.__extends) || (function () {
@@ -23,11 +23,6 @@ var __extends = (this && this.__extends) || (function () {
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var x;
if (typeof x !== "string") {
x[0] = "";
x[0] = new StringTreeCollection;
}
var StringTreeCollectionBase = (function () {
function StringTreeCollectionBase() {
}
@@ -40,3 +35,8 @@ var StringTreeCollection = (function (_super) {
}
return StringTreeCollection;
}(StringTreeCollectionBase));
var x;
if (typeof x !== "string") {
x[0] = "";
x[0] = new StringTreeCollection;
}
@@ -1,32 +1,31 @@
=== tests/cases/conformance/types/typeAliases/classDoesNotDependOnBaseTypes.ts ===
var x: StringTree;
>x : Symbol(x, Decl(classDoesNotDependOnBaseTypes.ts, 0, 3))
>StringTree : Symbol(StringTree, Decl(classDoesNotDependOnBaseTypes.ts, 4, 1))
if (typeof x !== "string") {
>x : Symbol(x, Decl(classDoesNotDependOnBaseTypes.ts, 0, 3))
x[0] = "";
>x : Symbol(x, Decl(classDoesNotDependOnBaseTypes.ts, 0, 3))
x[0] = new StringTreeCollection;
>x : Symbol(x, Decl(classDoesNotDependOnBaseTypes.ts, 0, 3))
>StringTreeCollection : Symbol(StringTreeCollection, Decl(classDoesNotDependOnBaseTypes.ts, 9, 1))
}
type StringTree = string | StringTreeCollection;
>StringTree : Symbol(StringTree, Decl(classDoesNotDependOnBaseTypes.ts, 4, 1))
>StringTreeCollection : Symbol(StringTreeCollection, Decl(classDoesNotDependOnBaseTypes.ts, 9, 1))
>StringTree : Symbol(StringTree, Decl(classDoesNotDependOnBaseTypes.ts, 0, 0))
>StringTreeCollection : Symbol(StringTreeCollection, Decl(classDoesNotDependOnBaseTypes.ts, 3, 1))
class StringTreeCollectionBase {
>StringTreeCollectionBase : Symbol(StringTreeCollectionBase, Decl(classDoesNotDependOnBaseTypes.ts, 6, 48))
>StringTreeCollectionBase : Symbol(StringTreeCollectionBase, Decl(classDoesNotDependOnBaseTypes.ts, 0, 48))
[n: number]: StringTree;
>n : Symbol(n, Decl(classDoesNotDependOnBaseTypes.ts, 8, 5))
>StringTree : Symbol(StringTree, Decl(classDoesNotDependOnBaseTypes.ts, 4, 1))
>n : Symbol(n, Decl(classDoesNotDependOnBaseTypes.ts, 2, 5))
>StringTree : Symbol(StringTree, Decl(classDoesNotDependOnBaseTypes.ts, 0, 0))
}
class StringTreeCollection extends StringTreeCollectionBase { }
>StringTreeCollection : Symbol(StringTreeCollection, Decl(classDoesNotDependOnBaseTypes.ts, 9, 1))
>StringTreeCollectionBase : Symbol(StringTreeCollectionBase, Decl(classDoesNotDependOnBaseTypes.ts, 6, 48))
>StringTreeCollection : Symbol(StringTreeCollection, Decl(classDoesNotDependOnBaseTypes.ts, 3, 1))
>StringTreeCollectionBase : Symbol(StringTreeCollectionBase, Decl(classDoesNotDependOnBaseTypes.ts, 0, 48))
var x: StringTree;
>x : Symbol(x, Decl(classDoesNotDependOnBaseTypes.ts, 7, 3))
>StringTree : Symbol(StringTree, Decl(classDoesNotDependOnBaseTypes.ts, 0, 0))
if (typeof x !== "string") {
>x : Symbol(x, Decl(classDoesNotDependOnBaseTypes.ts, 7, 3))
x[0] = "";
>x : Symbol(x, Decl(classDoesNotDependOnBaseTypes.ts, 7, 3))
x[0] = new StringTreeCollection;
>x : Symbol(x, Decl(classDoesNotDependOnBaseTypes.ts, 7, 3))
>StringTreeCollection : Symbol(StringTreeCollection, Decl(classDoesNotDependOnBaseTypes.ts, 3, 1))
}
@@ -1,4 +1,20 @@
=== tests/cases/conformance/types/typeAliases/classDoesNotDependOnBaseTypes.ts ===
type StringTree = string | StringTreeCollection;
>StringTree : StringTree
>StringTreeCollection : StringTreeCollection
class StringTreeCollectionBase {
>StringTreeCollectionBase : StringTreeCollectionBase
[n: number]: StringTree;
>n : number
>StringTree : StringTree
}
class StringTreeCollection extends StringTreeCollectionBase { }
>StringTreeCollection : StringTreeCollection
>StringTreeCollectionBase : StringTreeCollectionBase
var x: StringTree;
>x : StringTree
>StringTree : StringTree
@@ -24,20 +40,3 @@ if (typeof x !== "string") {
>new StringTreeCollection : StringTreeCollection
>StringTreeCollection : typeof StringTreeCollection
}
type StringTree = string | StringTreeCollection;
>StringTree : StringTree
>StringTreeCollection : StringTreeCollection
class StringTreeCollectionBase {
>StringTreeCollectionBase : StringTreeCollectionBase
[n: number]: StringTree;
>n : number
>StringTree : StringTree
}
class StringTreeCollection extends StringTreeCollectionBase { }
>StringTreeCollection : StringTreeCollection
>StringTreeCollectionBase : StringTreeCollectionBase
@@ -0,0 +1,20 @@
tests/cases/compiler/es5ExportDefaultClassDeclaration3.ts(2,21): error TS2449: Class 'C' used before its declaration.
==== tests/cases/compiler/es5ExportDefaultClassDeclaration3.ts (1 errors) ====
var before: C = new C();
~
!!! error TS2449: Class 'C' used before its declaration.
export default class C {
method(): C {
return new C();
}
}
var after: C = new C();
var t: typeof C = C;
@@ -1,30 +0,0 @@
=== tests/cases/compiler/es5ExportDefaultClassDeclaration3.ts ===
var before: C = new C();
>before : Symbol(before, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 3))
>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24))
>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24))
export default class C {
>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24))
method(): C {
>method : Symbol(C.method, Decl(es5ExportDefaultClassDeclaration3.ts, 3, 24))
>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24))
return new C();
>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24))
}
}
var after: C = new C();
>after : Symbol(after, Decl(es5ExportDefaultClassDeclaration3.ts, 9, 3))
>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24))
>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24))
var t: typeof C = C;
>t : Symbol(t, Decl(es5ExportDefaultClassDeclaration3.ts, 11, 3))
>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24))
>C : Symbol(C, Decl(es5ExportDefaultClassDeclaration3.ts, 1, 24))
@@ -1,33 +0,0 @@
=== tests/cases/compiler/es5ExportDefaultClassDeclaration3.ts ===
var before: C = new C();
>before : C
>C : C
>new C() : C
>C : typeof C
export default class C {
>C : C
method(): C {
>method : () => C
>C : C
return new C();
>new C() : C
>C : typeof C
}
}
var after: C = new C();
>after : C
>C : C
>new C() : C
>C : typeof C
var t: typeof C = C;
>t : typeof C
>C : typeof C
>C : typeof C
@@ -0,0 +1,17 @@
tests/cases/compiler/exportAssignmentOfGenericType1_0.ts(1,10): error TS2449: Class 'T' used before its declaration.
==== tests/cases/compiler/exportAssignmentOfGenericType1_1.ts (0 errors) ====
///<reference path='exportAssignmentOfGenericType1_0.ts'/>
import q = require("exportAssignmentOfGenericType1_0");
class M extends q<string> { }
var m: M;
var r: string = m.foo;
==== tests/cases/compiler/exportAssignmentOfGenericType1_0.ts (1 errors) ====
export = T;
~
!!! error TS2449: Class 'T' used before its declaration.
class T<X> { foo: X; }
@@ -1,14 +1,14 @@
tests/cases/conformance/es6/for-ofStatements/for-of14.ts(2,11): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator.
tests/cases/conformance/es6/for-ofStatements/for-of14.ts(8,11): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator.
==== 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.
class StringIterator {
next() {
return "";
}
}
}
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.
+6 -6
View File
@@ -1,18 +1,18 @@
//// [for-of14.ts]
var v: string;
for (v of new StringIterator) { } // Should fail because the iterator is not iterable
class StringIterator {
next() {
return "";
}
}
}
var v: string;
for (v of new StringIterator) { } // Should fail because the iterator is not iterable
//// [for-of14.js]
var v;
for (v of new StringIterator) { } // Should fail because the iterator is not iterable
class StringIterator {
next() {
return "";
}
}
var v;
for (v of new StringIterator) { } // Should fail because the iterator is not iterable
@@ -1,12 +1,7 @@
tests/cases/conformance/es6/for-ofStatements/for-of15.ts(2,11): error TS2490: The type returned by the 'next()' method of an iterator must have a 'value' property.
tests/cases/conformance/es6/for-ofStatements/for-of15.ts(11,11): error TS2490: The type returned by the 'next()' method of an iterator must have a 'value' property.
==== tests/cases/conformance/es6/for-ofStatements/for-of15.ts (1 errors) ====
var v: string;
for (v of new StringIterator) { } // Should fail
~~~~~~~~~~~~~~~~~~
!!! error TS2490: The type returned by the 'next()' method of an iterator must have a 'value' property.
class StringIterator {
next() {
return "";
@@ -14,4 +9,9 @@ tests/cases/conformance/es6/for-ofStatements/for-of15.ts(2,11): error TS2490: Th
[Symbol.iterator]() {
return this;
}
}
}
var v: string;
for (v of new StringIterator) { } // Should fail
~~~~~~~~~~~~~~~~~~
!!! error TS2490: The type returned by the 'next()' method of an iterator must have a 'value' property.
+6 -6
View File
@@ -1,7 +1,4 @@
//// [for-of15.ts]
var v: string;
for (v of new StringIterator) { } // Should fail
class StringIterator {
next() {
return "";
@@ -9,11 +6,12 @@ class StringIterator {
[Symbol.iterator]() {
return this;
}
}
}
var v: string;
for (v of new StringIterator) { } // Should fail
//// [for-of15.js]
var v;
for (v of new StringIterator) { } // Should fail
class StringIterator {
next() {
return "";
@@ -22,3 +20,5 @@ class StringIterator {
return this;
}
}
var v;
for (v of new StringIterator) { } // Should fail
@@ -1,14 +1,14 @@
tests/cases/conformance/es6/for-ofStatements/for-of16.ts(2,11): error TS2489: An iterator must have a 'next()' method.
tests/cases/conformance/es6/for-ofStatements/for-of16.ts(8,11): error TS2489: An iterator must have a 'next()' method.
==== tests/cases/conformance/es6/for-ofStatements/for-of16.ts (1 errors) ====
var v: string;
for (v of new StringIterator) { } // Should fail
~~~~~~~~~~~~~~~~~~
!!! error TS2489: An iterator must have a 'next()' method.
class StringIterator {
[Symbol.iterator]() {
return this;
}
}
}
var v: string;
for (v of new StringIterator) { } // Should fail
~~~~~~~~~~~~~~~~~~
!!! error TS2489: An iterator must have a 'next()' method.
+6 -6
View File
@@ -1,18 +1,18 @@
//// [for-of16.ts]
var v: string;
for (v of new StringIterator) { } // Should fail
class StringIterator {
[Symbol.iterator]() {
return this;
}
}
}
var v: string;
for (v of new StringIterator) { } // Should fail
//// [for-of16.js]
var v;
for (v of new StringIterator) { } // Should fail
class StringIterator {
[Symbol.iterator]() {
return this;
}
}
var v;
for (v of new StringIterator) { } // Should fail
@@ -1,12 +1,7 @@
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(14,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 {
@@ -17,4 +12,9 @@ tests/cases/conformance/es6/for-ofStatements/for-of17.ts(2,6): error TS2322: Typ
[Symbol.iterator]() {
return this;
}
}
}
var v: string;
for (v of new NumberIterator) { } // Should succeed
~
!!! error TS2322: Type 'number' is not assignable to type 'string'.
+6 -6
View File
@@ -1,7 +1,4 @@
//// [for-of17.ts]
var v: string;
for (v of new NumberIterator) { } // Should succeed
class NumberIterator {
next() {
return {
@@ -12,11 +9,12 @@ class NumberIterator {
[Symbol.iterator]() {
return this;
}
}
}
var v: string;
for (v of new NumberIterator) { } // Should succeed
//// [for-of17.js]
var v;
for (v of new NumberIterator) { } // Should succeed
class NumberIterator {
next() {
return {
@@ -28,3 +26,5 @@ class NumberIterator {
return this;
}
}
var v;
for (v of new NumberIterator) { } // Should succeed
+6 -6
View File
@@ -1,7 +1,4 @@
//// [for-of18.ts]
var v: string;
for (v of new StringIterator) { } // Should succeed
class StringIterator {
next() {
return {
@@ -12,11 +9,12 @@ class StringIterator {
[Symbol.iterator]() {
return this;
}
}
}
var v: string;
for (v of new StringIterator) { } // Should succeed
//// [for-of18.js]
var v;
for (v of new StringIterator) { } // Should succeed
class StringIterator {
next() {
return {
@@ -28,3 +26,5 @@ class StringIterator {
return this;
}
}
var v;
for (v of new StringIterator) { } // Should succeed
+13 -12
View File
@@ -1,23 +1,16 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of18.ts ===
var v: string;
>v : Symbol(v, Decl(for-of18.ts, 0, 3))
for (v of new StringIterator) { } // Should succeed
>v : Symbol(v, Decl(for-of18.ts, 0, 3))
>StringIterator : Symbol(StringIterator, Decl(for-of18.ts, 1, 33))
class StringIterator {
>StringIterator : Symbol(StringIterator, Decl(for-of18.ts, 1, 33))
>StringIterator : Symbol(StringIterator, Decl(for-of18.ts, 0, 0))
next() {
>next : Symbol(StringIterator.next, Decl(for-of18.ts, 3, 22))
>next : Symbol(StringIterator.next, Decl(for-of18.ts, 0, 22))
return {
value: "",
>value : Symbol(value, Decl(for-of18.ts, 5, 16))
>value : Symbol(value, Decl(for-of18.ts, 2, 16))
done: false
>done : Symbol(done, Decl(for-of18.ts, 6, 22))
>done : Symbol(done, Decl(for-of18.ts, 3, 22))
};
}
@@ -27,6 +20,14 @@ class StringIterator {
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
return this;
>this : Symbol(StringIterator, Decl(for-of18.ts, 1, 33))
>this : Symbol(StringIterator, Decl(for-of18.ts, 0, 0))
}
}
var v: string;
>v : Symbol(v, Decl(for-of18.ts, 12, 3))
for (v of new StringIterator) { } // Should succeed
>v : Symbol(v, Decl(for-of18.ts, 12, 3))
>StringIterator : Symbol(StringIterator, Decl(for-of18.ts, 0, 0))
+9 -8
View File
@@ -1,12 +1,4 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of18.ts ===
var v: string;
>v : string
for (v of new StringIterator) { } // Should succeed
>v : string
>new StringIterator : StringIterator
>StringIterator : typeof StringIterator
class StringIterator {
>StringIterator : StringIterator
@@ -35,3 +27,12 @@ class StringIterator {
>this : this
}
}
var v: string;
>v : string
for (v of new StringIterator) { } // Should succeed
>v : string
>new StringIterator : StringIterator
>StringIterator : typeof StringIterator
+7 -7
View File
@@ -1,8 +1,4 @@
//// [for-of19.ts]
for (var v of new FooIterator) {
v;
}
class Foo { }
class FooIterator {
next() {
@@ -14,12 +10,13 @@ class FooIterator {
[Symbol.iterator]() {
return this;
}
}
for (var v of new FooIterator) {
v;
}
//// [for-of19.js]
for (var v of new FooIterator) {
v;
}
class Foo {
}
class FooIterator {
@@ -33,3 +30,6 @@ class FooIterator {
return this;
}
}
for (var v of new FooIterator) {
v;
}
+15 -15
View File
@@ -1,28 +1,20 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of19.ts ===
for (var v of new FooIterator) {
>v : Symbol(v, Decl(for-of19.ts, 0, 8))
>FooIterator : Symbol(FooIterator, Decl(for-of19.ts, 4, 13))
v;
>v : Symbol(v, Decl(for-of19.ts, 0, 8))
}
class Foo { }
>Foo : Symbol(Foo, Decl(for-of19.ts, 2, 1))
>Foo : Symbol(Foo, Decl(for-of19.ts, 0, 0))
class FooIterator {
>FooIterator : Symbol(FooIterator, Decl(for-of19.ts, 4, 13))
>FooIterator : Symbol(FooIterator, Decl(for-of19.ts, 0, 13))
next() {
>next : Symbol(FooIterator.next, Decl(for-of19.ts, 5, 19))
>next : Symbol(FooIterator.next, Decl(for-of19.ts, 1, 19))
return {
value: new Foo,
>value : Symbol(value, Decl(for-of19.ts, 7, 16))
>Foo : Symbol(Foo, Decl(for-of19.ts, 2, 1))
>value : Symbol(value, Decl(for-of19.ts, 3, 16))
>Foo : Symbol(Foo, Decl(for-of19.ts, 0, 0))
done: false
>done : Symbol(done, Decl(for-of19.ts, 8, 27))
>done : Symbol(done, Decl(for-of19.ts, 4, 27))
};
}
@@ -32,6 +24,14 @@ class FooIterator {
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
return this;
>this : Symbol(FooIterator, Decl(for-of19.ts, 4, 13))
>this : Symbol(FooIterator, Decl(for-of19.ts, 0, 13))
}
}
for (var v of new FooIterator) {
>v : Symbol(v, Decl(for-of19.ts, 13, 8))
>FooIterator : Symbol(FooIterator, Decl(for-of19.ts, 0, 13))
v;
>v : Symbol(v, Decl(for-of19.ts, 13, 8))
}
+9 -9
View File
@@ -1,13 +1,4 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of19.ts ===
for (var v of new FooIterator) {
>v : Foo
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
v;
>v : Foo
}
class Foo { }
>Foo : Foo
@@ -40,3 +31,12 @@ class FooIterator {
>this : this
}
}
for (var v of new FooIterator) {
>v : Foo
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
v;
>v : Foo
}
+7 -7
View File
@@ -1,8 +1,4 @@
//// [for-of20.ts]
for (let v of new FooIterator) {
v;
}
class Foo { }
class FooIterator {
next() {
@@ -14,12 +10,13 @@ class FooIterator {
[Symbol.iterator]() {
return this;
}
}
for (let v of new FooIterator) {
v;
}
//// [for-of20.js]
for (let v of new FooIterator) {
v;
}
class Foo {
}
class FooIterator {
@@ -33,3 +30,6 @@ class FooIterator {
return this;
}
}
for (let v of new FooIterator) {
v;
}
+15 -15
View File
@@ -1,28 +1,20 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of20.ts ===
for (let v of new FooIterator) {
>v : Symbol(v, Decl(for-of20.ts, 0, 8))
>FooIterator : Symbol(FooIterator, Decl(for-of20.ts, 4, 13))
v;
>v : Symbol(v, Decl(for-of20.ts, 0, 8))
}
class Foo { }
>Foo : Symbol(Foo, Decl(for-of20.ts, 2, 1))
>Foo : Symbol(Foo, Decl(for-of20.ts, 0, 0))
class FooIterator {
>FooIterator : Symbol(FooIterator, Decl(for-of20.ts, 4, 13))
>FooIterator : Symbol(FooIterator, Decl(for-of20.ts, 0, 13))
next() {
>next : Symbol(FooIterator.next, Decl(for-of20.ts, 5, 19))
>next : Symbol(FooIterator.next, Decl(for-of20.ts, 1, 19))
return {
value: new Foo,
>value : Symbol(value, Decl(for-of20.ts, 7, 16))
>Foo : Symbol(Foo, Decl(for-of20.ts, 2, 1))
>value : Symbol(value, Decl(for-of20.ts, 3, 16))
>Foo : Symbol(Foo, Decl(for-of20.ts, 0, 0))
done: false
>done : Symbol(done, Decl(for-of20.ts, 8, 27))
>done : Symbol(done, Decl(for-of20.ts, 4, 27))
};
}
@@ -32,6 +24,14 @@ class FooIterator {
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
return this;
>this : Symbol(FooIterator, Decl(for-of20.ts, 4, 13))
>this : Symbol(FooIterator, Decl(for-of20.ts, 0, 13))
}
}
for (let v of new FooIterator) {
>v : Symbol(v, Decl(for-of20.ts, 13, 8))
>FooIterator : Symbol(FooIterator, Decl(for-of20.ts, 0, 13))
v;
>v : Symbol(v, Decl(for-of20.ts, 13, 8))
}
+9 -9
View File
@@ -1,13 +1,4 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of20.ts ===
for (let v of new FooIterator) {
>v : Foo
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
v;
>v : Foo
}
class Foo { }
>Foo : Foo
@@ -40,3 +31,12 @@ class FooIterator {
>this : this
}
}
for (let v of new FooIterator) {
>v : Foo
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
v;
>v : Foo
}
+7 -7
View File
@@ -1,8 +1,4 @@
//// [for-of21.ts]
for (const v of new FooIterator) {
v;
}
class Foo { }
class FooIterator {
next() {
@@ -14,12 +10,13 @@ class FooIterator {
[Symbol.iterator]() {
return this;
}
}
for (const v of new FooIterator) {
v;
}
//// [for-of21.js]
for (const v of new FooIterator) {
v;
}
class Foo {
}
class FooIterator {
@@ -33,3 +30,6 @@ class FooIterator {
return this;
}
}
for (const v of new FooIterator) {
v;
}
+15 -15
View File
@@ -1,28 +1,20 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of21.ts ===
for (const v of new FooIterator) {
>v : Symbol(v, Decl(for-of21.ts, 0, 10))
>FooIterator : Symbol(FooIterator, Decl(for-of21.ts, 4, 13))
v;
>v : Symbol(v, Decl(for-of21.ts, 0, 10))
}
class Foo { }
>Foo : Symbol(Foo, Decl(for-of21.ts, 2, 1))
>Foo : Symbol(Foo, Decl(for-of21.ts, 0, 0))
class FooIterator {
>FooIterator : Symbol(FooIterator, Decl(for-of21.ts, 4, 13))
>FooIterator : Symbol(FooIterator, Decl(for-of21.ts, 0, 13))
next() {
>next : Symbol(FooIterator.next, Decl(for-of21.ts, 5, 19))
>next : Symbol(FooIterator.next, Decl(for-of21.ts, 1, 19))
return {
value: new Foo,
>value : Symbol(value, Decl(for-of21.ts, 7, 16))
>Foo : Symbol(Foo, Decl(for-of21.ts, 2, 1))
>value : Symbol(value, Decl(for-of21.ts, 3, 16))
>Foo : Symbol(Foo, Decl(for-of21.ts, 0, 0))
done: false
>done : Symbol(done, Decl(for-of21.ts, 8, 27))
>done : Symbol(done, Decl(for-of21.ts, 4, 27))
};
}
@@ -32,6 +24,14 @@ class FooIterator {
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
return this;
>this : Symbol(FooIterator, Decl(for-of21.ts, 4, 13))
>this : Symbol(FooIterator, Decl(for-of21.ts, 0, 13))
}
}
for (const v of new FooIterator) {
>v : Symbol(v, Decl(for-of21.ts, 13, 10))
>FooIterator : Symbol(FooIterator, Decl(for-of21.ts, 0, 13))
v;
>v : Symbol(v, Decl(for-of21.ts, 13, 10))
}
+9 -9
View File
@@ -1,13 +1,4 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of21.ts ===
for (const v of new FooIterator) {
>v : Foo
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
v;
>v : Foo
}
class Foo { }
>Foo : Foo
@@ -40,3 +31,12 @@ class FooIterator {
>this : this
}
}
for (const v of new FooIterator) {
>v : Foo
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
v;
>v : Foo
}
+8 -8
View File
@@ -1,9 +1,4 @@
//// [for-of22.ts]
v;
for (var v of new FooIterator) {
}
class Foo { }
class FooIterator {
next() {
@@ -15,12 +10,14 @@ class FooIterator {
[Symbol.iterator]() {
return this;
}
}
v;
for (var v of new FooIterator) {
}
//// [for-of22.js]
v;
for (var v of new FooIterator) {
}
class Foo {
}
class FooIterator {
@@ -34,3 +31,6 @@ class FooIterator {
return this;
}
}
v;
for (var v of new FooIterator) {
}
+16 -16
View File
@@ -1,29 +1,20 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of22.ts ===
v;
>v : Symbol(v, Decl(for-of22.ts, 1, 8))
for (var v of new FooIterator) {
>v : Symbol(v, Decl(for-of22.ts, 1, 8))
>FooIterator : Symbol(FooIterator, Decl(for-of22.ts, 5, 13))
}
class Foo { }
>Foo : Symbol(Foo, Decl(for-of22.ts, 3, 1))
>Foo : Symbol(Foo, Decl(for-of22.ts, 0, 0))
class FooIterator {
>FooIterator : Symbol(FooIterator, Decl(for-of22.ts, 5, 13))
>FooIterator : Symbol(FooIterator, Decl(for-of22.ts, 0, 13))
next() {
>next : Symbol(FooIterator.next, Decl(for-of22.ts, 6, 19))
>next : Symbol(FooIterator.next, Decl(for-of22.ts, 1, 19))
return {
value: new Foo,
>value : Symbol(value, Decl(for-of22.ts, 8, 16))
>Foo : Symbol(Foo, Decl(for-of22.ts, 3, 1))
>value : Symbol(value, Decl(for-of22.ts, 3, 16))
>Foo : Symbol(Foo, Decl(for-of22.ts, 0, 0))
done: false
>done : Symbol(done, Decl(for-of22.ts, 9, 27))
>done : Symbol(done, Decl(for-of22.ts, 4, 27))
};
}
@@ -33,6 +24,15 @@ class FooIterator {
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
return this;
>this : Symbol(FooIterator, Decl(for-of22.ts, 5, 13))
>this : Symbol(FooIterator, Decl(for-of22.ts, 0, 13))
}
}
v;
>v : Symbol(v, Decl(for-of22.ts, 14, 8))
for (var v of new FooIterator) {
>v : Symbol(v, Decl(for-of22.ts, 14, 8))
>FooIterator : Symbol(FooIterator, Decl(for-of22.ts, 0, 13))
}
+10 -10
View File
@@ -1,14 +1,4 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of22.ts ===
v;
>v : Foo
for (var v of new FooIterator) {
>v : Foo
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
}
class Foo { }
>Foo : Foo
@@ -41,3 +31,13 @@ class FooIterator {
>this : this
}
}
v;
>v : Foo
for (var v of new FooIterator) {
>v : Foo
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
}
+7 -7
View File
@@ -1,8 +1,4 @@
//// [for-of23.ts]
for (const v of new FooIterator) {
const v = 0; // new scope
}
class Foo { }
class FooIterator {
next() {
@@ -14,12 +10,13 @@ class FooIterator {
[Symbol.iterator]() {
return this;
}
}
for (const v of new FooIterator) {
const v = 0; // new scope
}
//// [for-of23.js]
for (const v of new FooIterator) {
const v = 0; // new scope
}
class Foo {
}
class FooIterator {
@@ -33,3 +30,6 @@ class FooIterator {
return this;
}
}
for (const v of new FooIterator) {
const v = 0; // new scope
}
+15 -15
View File
@@ -1,28 +1,20 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of23.ts ===
for (const v of new FooIterator) {
>v : Symbol(v, Decl(for-of23.ts, 0, 10))
>FooIterator : Symbol(FooIterator, Decl(for-of23.ts, 4, 13))
const v = 0; // new scope
>v : Symbol(v, Decl(for-of23.ts, 1, 9))
}
class Foo { }
>Foo : Symbol(Foo, Decl(for-of23.ts, 2, 1))
>Foo : Symbol(Foo, Decl(for-of23.ts, 0, 0))
class FooIterator {
>FooIterator : Symbol(FooIterator, Decl(for-of23.ts, 4, 13))
>FooIterator : Symbol(FooIterator, Decl(for-of23.ts, 0, 13))
next() {
>next : Symbol(FooIterator.next, Decl(for-of23.ts, 5, 19))
>next : Symbol(FooIterator.next, Decl(for-of23.ts, 1, 19))
return {
value: new Foo,
>value : Symbol(value, Decl(for-of23.ts, 7, 16))
>Foo : Symbol(Foo, Decl(for-of23.ts, 2, 1))
>value : Symbol(value, Decl(for-of23.ts, 3, 16))
>Foo : Symbol(Foo, Decl(for-of23.ts, 0, 0))
done: false
>done : Symbol(done, Decl(for-of23.ts, 8, 27))
>done : Symbol(done, Decl(for-of23.ts, 4, 27))
};
}
@@ -32,6 +24,14 @@ class FooIterator {
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
return this;
>this : Symbol(FooIterator, Decl(for-of23.ts, 4, 13))
>this : Symbol(FooIterator, Decl(for-of23.ts, 0, 13))
}
}
for (const v of new FooIterator) {
>v : Symbol(v, Decl(for-of23.ts, 13, 10))
>FooIterator : Symbol(FooIterator, Decl(for-of23.ts, 0, 13))
const v = 0; // new scope
>v : Symbol(v, Decl(for-of23.ts, 14, 9))
}
+10 -10
View File
@@ -1,14 +1,4 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of23.ts ===
for (const v of new FooIterator) {
>v : Foo
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
const v = 0; // new scope
>v : 0
>0 : 0
}
class Foo { }
>Foo : Foo
@@ -41,3 +31,13 @@ class FooIterator {
>this : this
}
}
for (const v of new FooIterator) {
>v : Foo
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
const v = 0; // new scope
>v : 0
>0 : 0
}
+6 -6
View File
@@ -1,18 +1,18 @@
//// [for-of25.ts]
var x: any;
for (var v of new StringIterator) { }
class StringIterator {
[Symbol.iterator]() {
return x;
}
}
}
var x: any;
for (var v of new StringIterator) { }
//// [for-of25.js]
var x;
for (var v of new StringIterator) { }
class StringIterator {
[Symbol.iterator]() {
return x;
}
}
var x;
for (var v of new StringIterator) { }
+10 -9
View File
@@ -1,13 +1,6 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of25.ts ===
var x: any;
>x : Symbol(x, Decl(for-of25.ts, 0, 3))
for (var v of new StringIterator) { }
>v : Symbol(v, Decl(for-of25.ts, 1, 8))
>StringIterator : Symbol(StringIterator, Decl(for-of25.ts, 1, 37))
class StringIterator {
>StringIterator : Symbol(StringIterator, Decl(for-of25.ts, 1, 37))
>StringIterator : Symbol(StringIterator, Decl(for-of25.ts, 0, 0))
[Symbol.iterator]() {
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
@@ -15,6 +8,14 @@ class StringIterator {
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
return x;
>x : Symbol(x, Decl(for-of25.ts, 0, 3))
>x : Symbol(x, Decl(for-of25.ts, 6, 3))
}
}
var x: any;
>x : Symbol(x, Decl(for-of25.ts, 6, 3))
for (var v of new StringIterator) { }
>v : Symbol(v, Decl(for-of25.ts, 7, 8))
>StringIterator : Symbol(StringIterator, Decl(for-of25.ts, 0, 0))
+9 -8
View File
@@ -1,12 +1,4 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of25.ts ===
var x: any;
>x : any
for (var v of new StringIterator) { }
>v : any
>new StringIterator : StringIterator
>StringIterator : typeof StringIterator
class StringIterator {
>StringIterator : StringIterator
@@ -19,3 +11,12 @@ class StringIterator {
>x : any
}
}
var x: any;
>x : any
for (var v of new StringIterator) { }
>v : any
>new StringIterator : StringIterator
>StringIterator : typeof StringIterator
+6 -6
View File
@@ -1,7 +1,4 @@
//// [for-of26.ts]
var x: any;
for (var v of new StringIterator) { }
class StringIterator {
next() {
return x;
@@ -9,11 +6,12 @@ class StringIterator {
[Symbol.iterator]() {
return this;
}
}
}
var x: any;
for (var v of new StringIterator) { }
//// [for-of26.js]
var x;
for (var v of new StringIterator) { }
class StringIterator {
next() {
return x;
@@ -22,3 +20,5 @@ class StringIterator {
return this;
}
}
var x;
for (var v of new StringIterator) { }
+12 -11
View File
@@ -1,19 +1,12 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of26.ts ===
var x: any;
>x : Symbol(x, Decl(for-of26.ts, 0, 3))
for (var v of new StringIterator) { }
>v : Symbol(v, Decl(for-of26.ts, 1, 8))
>StringIterator : Symbol(StringIterator, Decl(for-of26.ts, 1, 37))
class StringIterator {
>StringIterator : Symbol(StringIterator, Decl(for-of26.ts, 1, 37))
>StringIterator : Symbol(StringIterator, Decl(for-of26.ts, 0, 0))
next() {
>next : Symbol(StringIterator.next, Decl(for-of26.ts, 3, 22))
>next : Symbol(StringIterator.next, Decl(for-of26.ts, 0, 22))
return x;
>x : Symbol(x, Decl(for-of26.ts, 0, 3))
>x : Symbol(x, Decl(for-of26.ts, 9, 3))
}
[Symbol.iterator]() {
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
@@ -21,6 +14,14 @@ class StringIterator {
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
return this;
>this : Symbol(StringIterator, Decl(for-of26.ts, 1, 37))
>this : Symbol(StringIterator, Decl(for-of26.ts, 0, 0))
}
}
var x: any;
>x : Symbol(x, Decl(for-of26.ts, 9, 3))
for (var v of new StringIterator) { }
>v : Symbol(v, Decl(for-of26.ts, 10, 8))
>StringIterator : Symbol(StringIterator, Decl(for-of26.ts, 0, 0))
+9 -8
View File
@@ -1,12 +1,4 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of26.ts ===
var x: any;
>x : any
for (var v of new StringIterator) { }
>v : any
>new StringIterator : StringIterator
>StringIterator : typeof StringIterator
class StringIterator {
>StringIterator : StringIterator
@@ -25,3 +17,12 @@ class StringIterator {
>this : this
}
}
var x: any;
>x : any
for (var v of new StringIterator) { }
>v : any
>new StringIterator : StringIterator
>StringIterator : typeof StringIterator
+4 -4
View File
@@ -1,11 +1,11 @@
//// [for-of27.ts]
for (var v of new StringIterator) { }
class StringIterator {
[Symbol.iterator]: any;
}
}
for (var v of new StringIterator) { }
//// [for-of27.js]
for (var v of new StringIterator) { }
class StringIterator {
}
for (var v of new StringIterator) { }
+6 -5
View File
@@ -1,13 +1,14 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of27.ts ===
for (var v of new StringIterator) { }
>v : Symbol(v, Decl(for-of27.ts, 0, 8))
>StringIterator : Symbol(StringIterator, Decl(for-of27.ts, 0, 37))
class StringIterator {
>StringIterator : Symbol(StringIterator, Decl(for-of27.ts, 0, 37))
>StringIterator : Symbol(StringIterator, Decl(for-of27.ts, 0, 0))
[Symbol.iterator]: any;
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
}
for (var v of new StringIterator) { }
>v : Symbol(v, Decl(for-of27.ts, 4, 8))
>StringIterator : Symbol(StringIterator, Decl(for-of27.ts, 0, 0))
+6 -5
View File
@@ -1,9 +1,4 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of27.ts ===
for (var v of new StringIterator) { }
>v : any
>new StringIterator : StringIterator
>StringIterator : typeof StringIterator
class StringIterator {
>StringIterator : StringIterator
@@ -12,3 +7,9 @@ class StringIterator {
>Symbol : SymbolConstructor
>iterator : symbol
}
for (var v of new StringIterator) { }
>v : any
>new StringIterator : StringIterator
>StringIterator : typeof StringIterator
+4 -4
View File
@@ -1,17 +1,17 @@
//// [for-of28.ts]
for (var v of new StringIterator) { }
class StringIterator {
next: any;
[Symbol.iterator]() {
return this;
}
}
}
for (var v of new StringIterator) { }
//// [for-of28.js]
for (var v of new StringIterator) { }
class StringIterator {
[Symbol.iterator]() {
return this;
}
}
for (var v of new StringIterator) { }
+8 -7
View File
@@ -1,13 +1,9 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of28.ts ===
for (var v of new StringIterator) { }
>v : Symbol(v, Decl(for-of28.ts, 0, 8))
>StringIterator : Symbol(StringIterator, Decl(for-of28.ts, 0, 37))
class StringIterator {
>StringIterator : Symbol(StringIterator, Decl(for-of28.ts, 0, 37))
>StringIterator : Symbol(StringIterator, Decl(for-of28.ts, 0, 0))
next: any;
>next : Symbol(StringIterator.next, Decl(for-of28.ts, 2, 22))
>next : Symbol(StringIterator.next, Decl(for-of28.ts, 0, 22))
[Symbol.iterator]() {
>Symbol.iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
@@ -15,6 +11,11 @@ class StringIterator {
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
return this;
>this : Symbol(StringIterator, Decl(for-of28.ts, 0, 37))
>this : Symbol(StringIterator, Decl(for-of28.ts, 0, 0))
}
}
for (var v of new StringIterator) { }
>v : Symbol(v, Decl(for-of28.ts, 7, 8))
>StringIterator : Symbol(StringIterator, Decl(for-of28.ts, 0, 0))
+6 -5
View File
@@ -1,9 +1,4 @@
=== tests/cases/conformance/es6/for-ofStatements/for-of28.ts ===
for (var v of new StringIterator) { }
>v : any
>new StringIterator : StringIterator
>StringIterator : typeof StringIterator
class StringIterator {
>StringIterator : StringIterator
@@ -19,3 +14,9 @@ class StringIterator {
>this : this
}
}
for (var v of new StringIterator) { }
>v : any
>new StringIterator : StringIterator
>StringIterator : typeof StringIterator
+11 -11
View File
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/for-ofStatements/for-of30.ts(1,15): error TS2322: Type 'StringIterator' is not assignable to type 'Iterable<string>'.
tests/cases/conformance/es6/for-ofStatements/for-of30.ts(16,15): error TS2322: Type 'StringIterator' is not assignable to type 'Iterable<string>'.
Types of property '[Symbol.iterator]' are incompatible.
Type '() => StringIterator' is not assignable to type '() => Iterator<string>'.
Type 'StringIterator' is not assignable to type 'Iterator<string>'.
@@ -7,15 +7,6 @@ tests/cases/conformance/es6/for-ofStatements/for-of30.ts(1,15): error TS2322: Ty
==== tests/cases/conformance/es6/for-ofStatements/for-of30.ts (1 errors) ====
for (var v of new StringIterator) { }
~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterable<string>'.
!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible.
!!! error TS2322: Type '() => StringIterator' is not assignable to type '() => Iterator<string>'.
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterator<string>'.
!!! error TS2322: Types of property 'return' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type '(value?: any) => IteratorResult<string>'.
class StringIterator {
next() {
return {
@@ -29,4 +20,13 @@ tests/cases/conformance/es6/for-ofStatements/for-of30.ts(1,15): error TS2322: Ty
[Symbol.iterator]() {
return this;
}
}
}
for (var v of new StringIterator) { }
~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterable<string>'.
!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible.
!!! error TS2322: Type '() => StringIterator' is not assignable to type '() => Iterator<string>'.
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterator<string>'.
!!! error TS2322: Types of property 'return' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type '(value?: any) => IteratorResult<string>'.
+4 -4
View File
@@ -1,6 +1,4 @@
//// [for-of30.ts]
for (var v of new StringIterator) { }
class StringIterator {
next() {
return {
@@ -14,10 +12,11 @@ class StringIterator {
[Symbol.iterator]() {
return this;
}
}
}
for (var v of new StringIterator) { }
//// [for-of30.js]
for (var v of new StringIterator) { }
class StringIterator {
constructor() {
this.return = 0;
@@ -32,3 +31,4 @@ class StringIterator {
return this;
}
}
for (var v of new StringIterator) { }
+13 -13
View File
@@ -1,4 +1,4 @@
tests/cases/conformance/es6/for-ofStatements/for-of31.ts(1,15): error TS2322: Type 'StringIterator' is not assignable to type 'Iterable<string>'.
tests/cases/conformance/es6/for-ofStatements/for-of31.ts(14,15): error TS2322: Type 'StringIterator' is not assignable to type 'Iterable<string>'.
Types of property '[Symbol.iterator]' are incompatible.
Type '() => StringIterator' is not assignable to type '() => Iterator<string>'.
Type 'StringIterator' is not assignable to type 'Iterator<string>'.
@@ -9,17 +9,6 @@ tests/cases/conformance/es6/for-ofStatements/for-of31.ts(1,15): error TS2322: Ty
==== tests/cases/conformance/es6/for-ofStatements/for-of31.ts (1 errors) ====
for (var v of new StringIterator) { }
~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterable<string>'.
!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible.
!!! error TS2322: Type '() => StringIterator' is not assignable to type '() => Iterator<string>'.
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterator<string>'.
!!! error TS2322: Types of property 'next' are incompatible.
!!! error TS2322: Type '() => { value: string; }' is not assignable to type '(value?: any) => IteratorResult<string>'.
!!! error TS2322: Type '{ value: string; }' is not assignable to type 'IteratorResult<string>'.
!!! error TS2322: Property 'done' is missing in type '{ value: string; }'.
class StringIterator {
next() {
return {
@@ -31,4 +20,15 @@ tests/cases/conformance/es6/for-ofStatements/for-of31.ts(1,15): error TS2322: Ty
[Symbol.iterator]() {
return this;
}
}
}
for (var v of new StringIterator) { }
~~~~~~~~~~~~~~~~~~
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterable<string>'.
!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible.
!!! error TS2322: Type '() => StringIterator' is not assignable to type '() => Iterator<string>'.
!!! error TS2322: Type 'StringIterator' is not assignable to type 'Iterator<string>'.
!!! error TS2322: Types of property 'next' are incompatible.
!!! error TS2322: Type '() => { value: string; }' is not assignable to type '(value?: any) => IteratorResult<string>'.
!!! error TS2322: Type '{ value: string; }' is not assignable to type 'IteratorResult<string>'.
!!! error TS2322: Property 'done' is missing in type '{ value: string; }'.
+4 -4
View File
@@ -1,6 +1,4 @@
//// [for-of31.ts]
for (var v of new StringIterator) { }
class StringIterator {
next() {
return {
@@ -12,10 +10,11 @@ class StringIterator {
[Symbol.iterator]() {
return this;
}
}
}
for (var v of new StringIterator) { }
//// [for-of31.js]
for (var v of new StringIterator) { }
class StringIterator {
next() {
return {
@@ -27,3 +26,4 @@ class StringIterator {
return this;
}
}
for (var v of new StringIterator) { }
@@ -1,16 +1,16 @@
tests/cases/conformance/es6/for-ofStatements/for-of33.ts(1,10): error TS7022: 'v' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
tests/cases/conformance/es6/for-ofStatements/for-of33.ts(4,5): error TS7023: '[Symbol.iterator]' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
tests/cases/conformance/es6/for-ofStatements/for-of33.ts(2,5): error TS7023: '[Symbol.iterator]' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
tests/cases/conformance/es6/for-ofStatements/for-of33.ts(7,10): error TS7022: 'v' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
==== tests/cases/conformance/es6/for-ofStatements/for-of33.ts (2 errors) ====
for (var v of new StringIterator) { }
~
!!! error TS7022: 'v' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
class StringIterator {
[Symbol.iterator]() {
~~~~~~~~~~~~~~~~~
!!! error TS7023: '[Symbol.iterator]' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
return v;
}
}
}
for (var v of new StringIterator) { }
~
!!! error TS7022: 'v' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
+4 -4
View File
@@ -1,16 +1,16 @@
//// [for-of33.ts]
for (var v of new StringIterator) { }
class StringIterator {
[Symbol.iterator]() {
return v;
}
}
}
for (var v of new StringIterator) { }
//// [for-of33.js]
for (var v of new StringIterator) { }
class StringIterator {
[Symbol.iterator]() {
return v;
}
}
for (var v of new StringIterator) { }
@@ -1,12 +1,8 @@
tests/cases/conformance/es6/for-ofStatements/for-of34.ts(1,10): error TS7022: 'v' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
tests/cases/conformance/es6/for-ofStatements/for-of34.ts(4,5): error TS7023: 'next' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
tests/cases/conformance/es6/for-ofStatements/for-of34.ts(2,5): error TS7023: 'next' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
tests/cases/conformance/es6/for-ofStatements/for-of34.ts(11,10): error TS7022: 'v' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
==== tests/cases/conformance/es6/for-ofStatements/for-of34.ts (2 errors) ====
for (var v of new StringIterator) { }
~
!!! error TS7022: 'v' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
class StringIterator {
next() {
~~~~
@@ -17,4 +13,8 @@ tests/cases/conformance/es6/for-ofStatements/for-of34.ts(4,5): error TS7023: 'ne
[Symbol.iterator]() {
return this;
}
}
}
for (var v of new StringIterator) { }
~
!!! error TS7022: 'v' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
+4 -4
View File
@@ -1,6 +1,4 @@
//// [for-of34.ts]
for (var v of new StringIterator) { }
class StringIterator {
next() {
return v;
@@ -9,10 +7,11 @@ class StringIterator {
[Symbol.iterator]() {
return this;
}
}
}
for (var v of new StringIterator) { }
//// [for-of34.js]
for (var v of new StringIterator) { }
class StringIterator {
next() {
return v;
@@ -21,3 +20,4 @@ class StringIterator {
return this;
}
}
for (var v of new StringIterator) { }
@@ -1,12 +1,8 @@
tests/cases/conformance/es6/for-ofStatements/for-of35.ts(1,10): error TS7022: 'v' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
tests/cases/conformance/es6/for-ofStatements/for-of35.ts(4,5): error TS7023: 'next' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
tests/cases/conformance/es6/for-ofStatements/for-of35.ts(2,5): error TS7023: 'next' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.
tests/cases/conformance/es6/for-ofStatements/for-of35.ts(14,10): error TS7022: 'v' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
==== tests/cases/conformance/es6/for-ofStatements/for-of35.ts (2 errors) ====
for (var v of new StringIterator) { }
~
!!! error TS7022: 'v' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
class StringIterator {
next() {
~~~~
@@ -20,4 +16,8 @@ tests/cases/conformance/es6/for-ofStatements/for-of35.ts(4,5): error TS7023: 'ne
[Symbol.iterator]() {
return this;
}
}
}
for (var v of new StringIterator) { }
~
!!! error TS7022: 'v' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
+4 -4
View File
@@ -1,6 +1,4 @@
//// [for-of35.ts]
for (var v of new StringIterator) { }
class StringIterator {
next() {
return {
@@ -12,10 +10,11 @@ class StringIterator {
[Symbol.iterator]() {
return this;
}
}
}
for (var v of new StringIterator) { }
//// [for-of35.js]
for (var v of new StringIterator) { }
class StringIterator {
next() {
return {
@@ -27,3 +26,4 @@ class StringIterator {
return this;
}
}
for (var v of new StringIterator) { }
@@ -1,5 +1,4 @@
//// [iterableArrayPattern1.ts]
var [a, b] = new SymbolIterator;
class SymbolIterator {
next() {
return {
@@ -11,10 +10,11 @@ class SymbolIterator {
[Symbol.iterator]() {
return this;
}
}
}
var [a, b] = new SymbolIterator;
//// [iterableArrayPattern1.js]
var [a, b] = new SymbolIterator;
class SymbolIterator {
next() {
return {
@@ -26,3 +26,4 @@ class SymbolIterator {
return this;
}
}
var [a, b] = new SymbolIterator;
@@ -1,22 +1,17 @@
=== tests/cases/conformance/es6/destructuring/iterableArrayPattern1.ts ===
var [a, b] = new SymbolIterator;
>a : Symbol(a, Decl(iterableArrayPattern1.ts, 0, 5))
>b : Symbol(b, Decl(iterableArrayPattern1.ts, 0, 7))
>SymbolIterator : Symbol(SymbolIterator, Decl(iterableArrayPattern1.ts, 0, 32))
class SymbolIterator {
>SymbolIterator : Symbol(SymbolIterator, Decl(iterableArrayPattern1.ts, 0, 32))
>SymbolIterator : Symbol(SymbolIterator, Decl(iterableArrayPattern1.ts, 0, 0))
next() {
>next : Symbol(SymbolIterator.next, Decl(iterableArrayPattern1.ts, 1, 22))
>next : Symbol(SymbolIterator.next, Decl(iterableArrayPattern1.ts, 0, 22))
return {
value: Symbol(),
>value : Symbol(value, Decl(iterableArrayPattern1.ts, 3, 16))
>value : Symbol(value, Decl(iterableArrayPattern1.ts, 2, 16))
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
done: false
>done : Symbol(done, Decl(iterableArrayPattern1.ts, 4, 28))
>done : Symbol(done, Decl(iterableArrayPattern1.ts, 3, 28))
};
}
@@ -27,6 +22,12 @@ class SymbolIterator {
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
return this;
>this : Symbol(SymbolIterator, Decl(iterableArrayPattern1.ts, 0, 32))
>this : Symbol(SymbolIterator, Decl(iterableArrayPattern1.ts, 0, 0))
}
}
var [a, b] = new SymbolIterator;
>a : Symbol(a, Decl(iterableArrayPattern1.ts, 13, 5))
>b : Symbol(b, Decl(iterableArrayPattern1.ts, 13, 7))
>SymbolIterator : Symbol(SymbolIterator, Decl(iterableArrayPattern1.ts, 0, 0))
@@ -1,10 +1,4 @@
=== tests/cases/conformance/es6/destructuring/iterableArrayPattern1.ts ===
var [a, b] = new SymbolIterator;
>a : symbol
>b : symbol
>new SymbolIterator : SymbolIterator
>SymbolIterator : typeof SymbolIterator
class SymbolIterator {
>SymbolIterator : SymbolIterator
@@ -35,3 +29,10 @@ class SymbolIterator {
>this : this
}
}
var [a, b] = new SymbolIterator;
>a : symbol
>b : symbol
>new SymbolIterator : SymbolIterator
>SymbolIterator : typeof SymbolIterator
@@ -1,13 +1,8 @@
tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts(2,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[any, any]'.
tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts(17,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[any, any]'.
Property '0' is missing in type 'FooIterator'.
==== tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts (1 errors) ====
function fun([a, b]) { }
fun(new FooIterator);
~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[any, any]'.
!!! error TS2345: Property '0' is missing in type 'FooIterator'.
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -21,4 +16,10 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern10.ts(2,5): error
[Symbol.iterator]() {
return this;
}
}
}
function fun([a, b]) { }
fun(new FooIterator);
~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[any, any]'.
!!! error TS2345: Property '0' is missing in type 'FooIterator'.
@@ -1,6 +1,4 @@
//// [iterableArrayPattern10.ts]
function fun([a, b]) { }
fun(new FooIterator);
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -14,11 +12,12 @@ class FooIterator {
[Symbol.iterator]() {
return this;
}
}
}
function fun([a, b]) { }
fun(new FooIterator);
//// [iterableArrayPattern10.js]
function fun([a, b]) { }
fun(new FooIterator);
class Bar {
}
class Foo extends Bar {
@@ -34,3 +33,5 @@ class FooIterator {
return this;
}
}
function fun([a, b]) { }
fun(new FooIterator);
@@ -1,6 +1,4 @@
//// [iterableArrayPattern11.ts]
function fun([a, b] = new FooIterator) { }
fun(new FooIterator);
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -14,11 +12,13 @@ class FooIterator {
[Symbol.iterator]() {
return this;
}
}
}
function fun([a, b] = new FooIterator) { }
fun(new FooIterator);
//// [iterableArrayPattern11.js]
function fun([a, b] = new FooIterator) { }
fun(new FooIterator);
class Bar {
}
class Foo extends Bar {
@@ -34,3 +34,5 @@ class FooIterator {
return this;
}
}
function fun([a, b] = new FooIterator) { }
fun(new FooIterator);
@@ -1,36 +1,26 @@
=== tests/cases/conformance/es6/destructuring/iterableArrayPattern11.ts ===
function fun([a, b] = new FooIterator) { }
>fun : Symbol(fun, Decl(iterableArrayPattern11.ts, 0, 0))
>a : Symbol(a, Decl(iterableArrayPattern11.ts, 0, 14))
>b : Symbol(b, Decl(iterableArrayPattern11.ts, 0, 16))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern11.ts, 3, 27))
fun(new FooIterator);
>fun : Symbol(fun, Decl(iterableArrayPattern11.ts, 0, 0))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern11.ts, 3, 27))
class Bar { x }
>Bar : Symbol(Bar, Decl(iterableArrayPattern11.ts, 1, 21))
>x : Symbol(Bar.x, Decl(iterableArrayPattern11.ts, 2, 11))
>Bar : Symbol(Bar, Decl(iterableArrayPattern11.ts, 0, 0))
>x : Symbol(Bar.x, Decl(iterableArrayPattern11.ts, 0, 11))
class Foo extends Bar { y }
>Foo : Symbol(Foo, Decl(iterableArrayPattern11.ts, 2, 15))
>Bar : Symbol(Bar, Decl(iterableArrayPattern11.ts, 1, 21))
>y : Symbol(Foo.y, Decl(iterableArrayPattern11.ts, 3, 23))
>Foo : Symbol(Foo, Decl(iterableArrayPattern11.ts, 0, 15))
>Bar : Symbol(Bar, Decl(iterableArrayPattern11.ts, 0, 0))
>y : Symbol(Foo.y, Decl(iterableArrayPattern11.ts, 1, 23))
class FooIterator {
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern11.ts, 3, 27))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern11.ts, 1, 27))
next() {
>next : Symbol(FooIterator.next, Decl(iterableArrayPattern11.ts, 4, 19))
>next : Symbol(FooIterator.next, Decl(iterableArrayPattern11.ts, 2, 19))
return {
value: new Foo,
>value : Symbol(value, Decl(iterableArrayPattern11.ts, 6, 16))
>Foo : Symbol(Foo, Decl(iterableArrayPattern11.ts, 2, 15))
>value : Symbol(value, Decl(iterableArrayPattern11.ts, 4, 16))
>Foo : Symbol(Foo, Decl(iterableArrayPattern11.ts, 0, 15))
done: false
>done : Symbol(done, Decl(iterableArrayPattern11.ts, 7, 27))
>done : Symbol(done, Decl(iterableArrayPattern11.ts, 5, 27))
};
}
@@ -41,6 +31,17 @@ class FooIterator {
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
return this;
>this : Symbol(FooIterator, Decl(iterableArrayPattern11.ts, 3, 27))
>this : Symbol(FooIterator, Decl(iterableArrayPattern11.ts, 1, 27))
}
}
function fun([a, b] = new FooIterator) { }
>fun : Symbol(fun, Decl(iterableArrayPattern11.ts, 13, 1))
>a : Symbol(a, Decl(iterableArrayPattern11.ts, 15, 14))
>b : Symbol(b, Decl(iterableArrayPattern11.ts, 15, 16))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern11.ts, 1, 27))
fun(new FooIterator);
>fun : Symbol(fun, Decl(iterableArrayPattern11.ts, 13, 1))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern11.ts, 1, 27))
@@ -1,17 +1,4 @@
=== tests/cases/conformance/es6/destructuring/iterableArrayPattern11.ts ===
function fun([a, b] = new FooIterator) { }
>fun : ([a, b]?: FooIterator) => void
>a : Foo
>b : Foo
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
fun(new FooIterator);
>fun(new FooIterator) : void
>fun : ([a, b]?: FooIterator) => void
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
class Bar { x }
>Bar : Bar
>x : any
@@ -51,3 +38,17 @@ class FooIterator {
>this : this
}
}
function fun([a, b] = new FooIterator) { }
>fun : ([a, b]?: FooIterator) => void
>a : Foo
>b : Foo
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
fun(new FooIterator);
>fun(new FooIterator) : void
>fun : ([a, b]?: FooIterator) => void
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
@@ -1,6 +1,4 @@
//// [iterableArrayPattern12.ts]
function fun([a, ...b] = new FooIterator) { }
fun(new FooIterator);
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -14,11 +12,12 @@ class FooIterator {
[Symbol.iterator]() {
return this;
}
}
}
function fun([a, ...b] = new FooIterator) { }
fun(new FooIterator);
//// [iterableArrayPattern12.js]
function fun([a, ...b] = new FooIterator) { }
fun(new FooIterator);
class Bar {
}
class Foo extends Bar {
@@ -34,3 +33,5 @@ class FooIterator {
return this;
}
}
function fun([a, ...b] = new FooIterator) { }
fun(new FooIterator);
@@ -1,36 +1,26 @@
=== tests/cases/conformance/es6/destructuring/iterableArrayPattern12.ts ===
function fun([a, ...b] = new FooIterator) { }
>fun : Symbol(fun, Decl(iterableArrayPattern12.ts, 0, 0))
>a : Symbol(a, Decl(iterableArrayPattern12.ts, 0, 14))
>b : Symbol(b, Decl(iterableArrayPattern12.ts, 0, 16))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern12.ts, 3, 27))
fun(new FooIterator);
>fun : Symbol(fun, Decl(iterableArrayPattern12.ts, 0, 0))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern12.ts, 3, 27))
class Bar { x }
>Bar : Symbol(Bar, Decl(iterableArrayPattern12.ts, 1, 21))
>x : Symbol(Bar.x, Decl(iterableArrayPattern12.ts, 2, 11))
>Bar : Symbol(Bar, Decl(iterableArrayPattern12.ts, 0, 0))
>x : Symbol(Bar.x, Decl(iterableArrayPattern12.ts, 0, 11))
class Foo extends Bar { y }
>Foo : Symbol(Foo, Decl(iterableArrayPattern12.ts, 2, 15))
>Bar : Symbol(Bar, Decl(iterableArrayPattern12.ts, 1, 21))
>y : Symbol(Foo.y, Decl(iterableArrayPattern12.ts, 3, 23))
>Foo : Symbol(Foo, Decl(iterableArrayPattern12.ts, 0, 15))
>Bar : Symbol(Bar, Decl(iterableArrayPattern12.ts, 0, 0))
>y : Symbol(Foo.y, Decl(iterableArrayPattern12.ts, 1, 23))
class FooIterator {
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern12.ts, 3, 27))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern12.ts, 1, 27))
next() {
>next : Symbol(FooIterator.next, Decl(iterableArrayPattern12.ts, 4, 19))
>next : Symbol(FooIterator.next, Decl(iterableArrayPattern12.ts, 2, 19))
return {
value: new Foo,
>value : Symbol(value, Decl(iterableArrayPattern12.ts, 6, 16))
>Foo : Symbol(Foo, Decl(iterableArrayPattern12.ts, 2, 15))
>value : Symbol(value, Decl(iterableArrayPattern12.ts, 4, 16))
>Foo : Symbol(Foo, Decl(iterableArrayPattern12.ts, 0, 15))
done: false
>done : Symbol(done, Decl(iterableArrayPattern12.ts, 7, 27))
>done : Symbol(done, Decl(iterableArrayPattern12.ts, 5, 27))
};
}
@@ -41,6 +31,17 @@ class FooIterator {
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
return this;
>this : Symbol(FooIterator, Decl(iterableArrayPattern12.ts, 3, 27))
>this : Symbol(FooIterator, Decl(iterableArrayPattern12.ts, 1, 27))
}
}
function fun([a, ...b] = new FooIterator) { }
>fun : Symbol(fun, Decl(iterableArrayPattern12.ts, 13, 1))
>a : Symbol(a, Decl(iterableArrayPattern12.ts, 15, 14))
>b : Symbol(b, Decl(iterableArrayPattern12.ts, 15, 16))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern12.ts, 1, 27))
fun(new FooIterator);
>fun : Symbol(fun, Decl(iterableArrayPattern12.ts, 13, 1))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern12.ts, 1, 27))
@@ -1,17 +1,4 @@
=== tests/cases/conformance/es6/destructuring/iterableArrayPattern12.ts ===
function fun([a, ...b] = new FooIterator) { }
>fun : ([a, ...b]?: FooIterator) => void
>a : Foo
>b : Foo[]
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
fun(new FooIterator);
>fun(new FooIterator) : void
>fun : ([a, ...b]?: FooIterator) => void
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
class Bar { x }
>Bar : Bar
>x : any
@@ -51,3 +38,17 @@ class FooIterator {
>this : this
}
}
function fun([a, ...b] = new FooIterator) { }
>fun : ([a, ...b]?: FooIterator) => void
>a : Foo
>b : Foo[]
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
fun(new FooIterator);
>fun(new FooIterator) : void
>fun : ([a, ...b]?: FooIterator) => void
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
@@ -1,6 +1,4 @@
//// [iterableArrayPattern13.ts]
function fun([a, ...b]) { }
fun(new FooIterator);
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -14,11 +12,12 @@ class FooIterator {
[Symbol.iterator]() {
return this;
}
}
}
function fun([a, ...b]) { }
fun(new FooIterator);
//// [iterableArrayPattern13.js]
function fun([a, ...b]) { }
fun(new FooIterator);
class Bar {
}
class Foo extends Bar {
@@ -34,3 +33,5 @@ class FooIterator {
return this;
}
}
function fun([a, ...b]) { }
fun(new FooIterator);
@@ -1,35 +1,26 @@
=== tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts ===
function fun([a, ...b]) { }
>fun : Symbol(fun, Decl(iterableArrayPattern13.ts, 0, 0))
>a : Symbol(a, Decl(iterableArrayPattern13.ts, 0, 14))
>b : Symbol(b, Decl(iterableArrayPattern13.ts, 0, 16))
fun(new FooIterator);
>fun : Symbol(fun, Decl(iterableArrayPattern13.ts, 0, 0))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern13.ts, 3, 27))
class Bar { x }
>Bar : Symbol(Bar, Decl(iterableArrayPattern13.ts, 1, 21))
>x : Symbol(Bar.x, Decl(iterableArrayPattern13.ts, 2, 11))
>Bar : Symbol(Bar, Decl(iterableArrayPattern13.ts, 0, 0))
>x : Symbol(Bar.x, Decl(iterableArrayPattern13.ts, 0, 11))
class Foo extends Bar { y }
>Foo : Symbol(Foo, Decl(iterableArrayPattern13.ts, 2, 15))
>Bar : Symbol(Bar, Decl(iterableArrayPattern13.ts, 1, 21))
>y : Symbol(Foo.y, Decl(iterableArrayPattern13.ts, 3, 23))
>Foo : Symbol(Foo, Decl(iterableArrayPattern13.ts, 0, 15))
>Bar : Symbol(Bar, Decl(iterableArrayPattern13.ts, 0, 0))
>y : Symbol(Foo.y, Decl(iterableArrayPattern13.ts, 1, 23))
class FooIterator {
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern13.ts, 3, 27))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern13.ts, 1, 27))
next() {
>next : Symbol(FooIterator.next, Decl(iterableArrayPattern13.ts, 4, 19))
>next : Symbol(FooIterator.next, Decl(iterableArrayPattern13.ts, 2, 19))
return {
value: new Foo,
>value : Symbol(value, Decl(iterableArrayPattern13.ts, 6, 16))
>Foo : Symbol(Foo, Decl(iterableArrayPattern13.ts, 2, 15))
>value : Symbol(value, Decl(iterableArrayPattern13.ts, 4, 16))
>Foo : Symbol(Foo, Decl(iterableArrayPattern13.ts, 0, 15))
done: false
>done : Symbol(done, Decl(iterableArrayPattern13.ts, 7, 27))
>done : Symbol(done, Decl(iterableArrayPattern13.ts, 5, 27))
};
}
@@ -40,6 +31,16 @@ class FooIterator {
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
return this;
>this : Symbol(FooIterator, Decl(iterableArrayPattern13.ts, 3, 27))
>this : Symbol(FooIterator, Decl(iterableArrayPattern13.ts, 1, 27))
}
}
function fun([a, ...b]) { }
>fun : Symbol(fun, Decl(iterableArrayPattern13.ts, 13, 1))
>a : Symbol(a, Decl(iterableArrayPattern13.ts, 15, 14))
>b : Symbol(b, Decl(iterableArrayPattern13.ts, 15, 16))
fun(new FooIterator);
>fun : Symbol(fun, Decl(iterableArrayPattern13.ts, 13, 1))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern13.ts, 1, 27))
@@ -1,15 +1,4 @@
=== tests/cases/conformance/es6/destructuring/iterableArrayPattern13.ts ===
function fun([a, ...b]) { }
>fun : ([a, ...b]: Iterable<any>) => void
>a : any
>b : any[]
fun(new FooIterator);
>fun(new FooIterator) : void
>fun : ([a, ...b]: Iterable<any>) => void
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
class Bar { x }
>Bar : Bar
>x : any
@@ -49,3 +38,15 @@ class FooIterator {
>this : this
}
}
function fun([a, ...b]) { }
>fun : ([a, ...b]: Iterable<any>) => void
>a : any
>b : any[]
fun(new FooIterator);
>fun(new FooIterator) : void
>fun : ([a, ...b]: Iterable<any>) => void
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
@@ -1,11 +1,7 @@
tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts(1,17): error TS2501: A rest element cannot contain a binding pattern.
tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts(16,17): error TS2501: A rest element cannot contain a binding pattern.
==== tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts (1 errors) ====
function fun(...[a, ...b]) { }
~~~~~~~~~
!!! error TS2501: A rest element cannot contain a binding pattern.
fun(new FooIterator);
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -19,4 +15,9 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern14.ts(1,17): error
[Symbol.iterator]() {
return this;
}
}
}
function fun(...[a, ...b]) { }
~~~~~~~~~
!!! error TS2501: A rest element cannot contain a binding pattern.
fun(new FooIterator);
@@ -1,6 +1,4 @@
//// [iterableArrayPattern14.ts]
function fun(...[a, ...b]) { }
fun(new FooIterator);
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -14,11 +12,12 @@ class FooIterator {
[Symbol.iterator]() {
return this;
}
}
}
function fun(...[a, ...b]) { }
fun(new FooIterator);
//// [iterableArrayPattern14.js]
function fun(...[a, ...b]) { }
fun(new FooIterator);
class Bar {
}
class Foo extends Bar {
@@ -34,3 +33,5 @@ class FooIterator {
return this;
}
}
function fun(...[a, ...b]) { }
fun(new FooIterator);
@@ -1,11 +1,7 @@
tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts(1,17): error TS2501: A rest element cannot contain a binding pattern.
tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts(16,17): error TS2501: A rest element cannot contain a binding pattern.
==== tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts (1 errors) ====
function fun(...[a, b]: Bar[]) { }
~~~~~~
!!! error TS2501: A rest element cannot contain a binding pattern.
fun(...new FooIterator);
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -19,4 +15,9 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern15.ts(1,17): error
[Symbol.iterator]() {
return this;
}
}
}
function fun(...[a, b]: Bar[]) { }
~~~~~~
!!! error TS2501: A rest element cannot contain a binding pattern.
fun(...new FooIterator);
@@ -1,6 +1,4 @@
//// [iterableArrayPattern15.ts]
function fun(...[a, b]: Bar[]) { }
fun(...new FooIterator);
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -14,11 +12,12 @@ class FooIterator {
[Symbol.iterator]() {
return this;
}
}
}
function fun(...[a, b]: Bar[]) { }
fun(...new FooIterator);
//// [iterableArrayPattern15.js]
function fun(...[a, b]) { }
fun(...new FooIterator);
class Bar {
}
class Foo extends Bar {
@@ -34,3 +33,5 @@ class FooIterator {
return this;
}
}
function fun(...[a, b]) { }
fun(...new FooIterator);
@@ -1,9 +1,10 @@
tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts(1,17): error TS2501: A rest element cannot contain a binding pattern.
tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts(2,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[Bar, Bar]'.
Property '0' is missing in type 'FooIterator'.
tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts(2,12): error TS2449: Class 'FooIteratorIterator' used before its declaration.
==== tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts (2 errors) ====
==== tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts (3 errors) ====
function fun(...[a, b]: [Bar, Bar][]) { }
~~~~~~
!!! error TS2501: A rest element cannot contain a binding pattern.
@@ -11,6 +12,8 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts(2,5): error
~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type '[Bar, Bar]'.
!!! error TS2345: Property '0' is missing in type 'FooIterator'.
~~~~~~~~~~~~~~~~~~~
!!! error TS2449: Class 'FooIteratorIterator' used before its declaration.
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -1,16 +1,9 @@
tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts(1,17): error TS2501: A rest element cannot contain a binding pattern.
tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts(2,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar'.
tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts(16,17): error TS2501: A rest element cannot contain a binding pattern.
tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts(17,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar'.
Property 'x' is missing in type 'FooIterator'.
==== tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts (2 errors) ====
function fun(...[a, b]: Bar[]) { }
~~~~~~
!!! error TS2501: A rest element cannot contain a binding pattern.
fun(new FooIterator);
~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar'.
!!! error TS2345: Property 'x' is missing in type 'FooIterator'.
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -24,4 +17,12 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern17.ts(2,5): error
[Symbol.iterator]() {
return this;
}
}
}
function fun(...[a, b]: Bar[]) { }
~~~~~~
!!! error TS2501: A rest element cannot contain a binding pattern.
fun(new FooIterator);
~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar'.
!!! error TS2345: Property 'x' is missing in type 'FooIterator'.
@@ -1,6 +1,4 @@
//// [iterableArrayPattern17.ts]
function fun(...[a, b]: Bar[]) { }
fun(new FooIterator);
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -14,11 +12,12 @@ class FooIterator {
[Symbol.iterator]() {
return this;
}
}
}
function fun(...[a, b]: Bar[]) { }
fun(new FooIterator);
//// [iterableArrayPattern17.js]
function fun(...[a, b]) { }
fun(new FooIterator);
class Bar {
}
class Foo extends Bar {
@@ -34,3 +33,5 @@ class FooIterator {
return this;
}
}
function fun(...[a, b]) { }
fun(new FooIterator);
@@ -1,13 +1,8 @@
tests/cases/conformance/es6/destructuring/iterableArrayPattern18.ts(2,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar[]'.
tests/cases/conformance/es6/destructuring/iterableArrayPattern18.ts(17,5): error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar[]'.
Property 'length' is missing in type 'FooIterator'.
==== tests/cases/conformance/es6/destructuring/iterableArrayPattern18.ts (1 errors) ====
function fun([a, b]: Bar[]) { }
fun(new FooIterator);
~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar[]'.
!!! error TS2345: Property 'length' is missing in type 'FooIterator'.
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -21,4 +16,10 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern18.ts(2,5): error
[Symbol.iterator]() {
return this;
}
}
}
function fun([a, b]: Bar[]) { }
fun(new FooIterator);
~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type 'FooIterator' is not assignable to parameter of type 'Bar[]'.
!!! error TS2345: Property 'length' is missing in type 'FooIterator'.
@@ -1,6 +1,4 @@
//// [iterableArrayPattern18.ts]
function fun([a, b]: Bar[]) { }
fun(new FooIterator);
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -14,11 +12,12 @@ class FooIterator {
[Symbol.iterator]() {
return this;
}
}
}
function fun([a, b]: Bar[]) { }
fun(new FooIterator);
//// [iterableArrayPattern18.js]
function fun([a, b]) { }
fun(new FooIterator);
class Bar {
}
class Foo extends Bar {
@@ -34,3 +33,5 @@ class FooIterator {
return this;
}
}
function fun([a, b]) { }
fun(new FooIterator);
@@ -1,13 +1,8 @@
tests/cases/conformance/es6/destructuring/iterableArrayPattern19.ts(2,5): error TS2345: Argument of type 'FooArrayIterator' is not assignable to parameter of type 'Bar[][]'.
tests/cases/conformance/es6/destructuring/iterableArrayPattern19.ts(17,5): error TS2345: Argument of type 'FooArrayIterator' is not assignable to parameter of type 'Bar[][]'.
Property 'length' is missing in type 'FooArrayIterator'.
==== tests/cases/conformance/es6/destructuring/iterableArrayPattern19.ts (1 errors) ====
function fun([[a], b]: Bar[][]) { }
fun(new FooArrayIterator);
~~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type 'FooArrayIterator' is not assignable to parameter of type 'Bar[][]'.
!!! error TS2345: Property 'length' is missing in type 'FooArrayIterator'.
class Bar { x }
class Foo extends Bar { y }
class FooArrayIterator {
@@ -21,4 +16,10 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern19.ts(2,5): error
[Symbol.iterator]() {
return this;
}
}
}
function fun([[a], b]: Bar[][]) { }
fun(new FooArrayIterator);
~~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type 'FooArrayIterator' is not assignable to parameter of type 'Bar[][]'.
!!! error TS2345: Property 'length' is missing in type 'FooArrayIterator'.
@@ -1,6 +1,4 @@
//// [iterableArrayPattern19.ts]
function fun([[a], b]: Bar[][]) { }
fun(new FooArrayIterator);
class Bar { x }
class Foo extends Bar { y }
class FooArrayIterator {
@@ -14,11 +12,12 @@ class FooArrayIterator {
[Symbol.iterator]() {
return this;
}
}
}
function fun([[a], b]: Bar[][]) { }
fun(new FooArrayIterator);
//// [iterableArrayPattern19.js]
function fun([[a], b]) { }
fun(new FooArrayIterator);
class Bar {
}
class Foo extends Bar {
@@ -34,3 +33,5 @@ class FooArrayIterator {
return this;
}
}
function fun([[a], b]) { }
fun(new FooArrayIterator);
@@ -1,5 +1,4 @@
//// [iterableArrayPattern2.ts]
var [a, ...b] = new SymbolIterator;
class SymbolIterator {
next() {
return {
@@ -11,10 +10,11 @@ class SymbolIterator {
[Symbol.iterator]() {
return this;
}
}
}
var [a, ...b] = new SymbolIterator;
//// [iterableArrayPattern2.js]
var [a, ...b] = new SymbolIterator;
class SymbolIterator {
next() {
return {
@@ -26,3 +26,4 @@ class SymbolIterator {
return this;
}
}
var [a, ...b] = new SymbolIterator;
@@ -1,22 +1,17 @@
=== tests/cases/conformance/es6/destructuring/iterableArrayPattern2.ts ===
var [a, ...b] = new SymbolIterator;
>a : Symbol(a, Decl(iterableArrayPattern2.ts, 0, 5))
>b : Symbol(b, Decl(iterableArrayPattern2.ts, 0, 7))
>SymbolIterator : Symbol(SymbolIterator, Decl(iterableArrayPattern2.ts, 0, 35))
class SymbolIterator {
>SymbolIterator : Symbol(SymbolIterator, Decl(iterableArrayPattern2.ts, 0, 35))
>SymbolIterator : Symbol(SymbolIterator, Decl(iterableArrayPattern2.ts, 0, 0))
next() {
>next : Symbol(SymbolIterator.next, Decl(iterableArrayPattern2.ts, 1, 22))
>next : Symbol(SymbolIterator.next, Decl(iterableArrayPattern2.ts, 0, 22))
return {
value: Symbol(),
>value : Symbol(value, Decl(iterableArrayPattern2.ts, 3, 16))
>value : Symbol(value, Decl(iterableArrayPattern2.ts, 2, 16))
>Symbol : Symbol(Symbol, Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --))
done: false
>done : Symbol(done, Decl(iterableArrayPattern2.ts, 4, 28))
>done : Symbol(done, Decl(iterableArrayPattern2.ts, 3, 28))
};
}
@@ -27,6 +22,12 @@ class SymbolIterator {
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
return this;
>this : Symbol(SymbolIterator, Decl(iterableArrayPattern2.ts, 0, 35))
>this : Symbol(SymbolIterator, Decl(iterableArrayPattern2.ts, 0, 0))
}
}
var [a, ...b] = new SymbolIterator;
>a : Symbol(a, Decl(iterableArrayPattern2.ts, 13, 5))
>b : Symbol(b, Decl(iterableArrayPattern2.ts, 13, 7))
>SymbolIterator : Symbol(SymbolIterator, Decl(iterableArrayPattern2.ts, 0, 0))
@@ -1,10 +1,4 @@
=== tests/cases/conformance/es6/destructuring/iterableArrayPattern2.ts ===
var [a, ...b] = new SymbolIterator;
>a : symbol
>b : symbol[]
>new SymbolIterator : SymbolIterator
>SymbolIterator : typeof SymbolIterator
class SymbolIterator {
>SymbolIterator : SymbolIterator
@@ -35,3 +29,10 @@ class SymbolIterator {
>this : this
}
}
var [a, ...b] = new SymbolIterator;
>a : symbol
>b : symbol[]
>new SymbolIterator : SymbolIterator
>SymbolIterator : typeof SymbolIterator
@@ -1,11 +1,7 @@
tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts(1,17): error TS2501: A rest element cannot contain a binding pattern.
tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts(16,17): error TS2501: A rest element cannot contain a binding pattern.
==== tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts (1 errors) ====
function fun(...[[a = new Foo], b = [new Foo]]: Bar[][]) { }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2501: A rest element cannot contain a binding pattern.
fun(...new FooArrayIterator);
class Bar { x }
class Foo extends Bar { y }
class FooArrayIterator {
@@ -19,4 +15,9 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern20.ts(1,17): error
[Symbol.iterator]() {
return this;
}
}
}
function fun(...[[a = new Foo], b = [new Foo]]: Bar[][]) { }
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2501: A rest element cannot contain a binding pattern.
fun(...new FooArrayIterator);
@@ -1,6 +1,4 @@
//// [iterableArrayPattern20.ts]
function fun(...[[a = new Foo], b = [new Foo]]: Bar[][]) { }
fun(...new FooArrayIterator);
class Bar { x }
class Foo extends Bar { y }
class FooArrayIterator {
@@ -14,11 +12,12 @@ class FooArrayIterator {
[Symbol.iterator]() {
return this;
}
}
}
function fun(...[[a = new Foo], b = [new Foo]]: Bar[][]) { }
fun(...new FooArrayIterator);
//// [iterableArrayPattern20.js]
function fun(...[[a = new Foo], b = [new Foo]]) { }
fun(...new FooArrayIterator);
class Bar {
}
class Foo extends Bar {
@@ -34,3 +33,5 @@ class FooArrayIterator {
return this;
}
}
function fun(...[[a = new Foo], b = [new Foo]]) { }
fun(...new FooArrayIterator);
@@ -1,6 +1,4 @@
//// [iterableArrayPattern3.ts]
var a: Bar, b: Bar;
[a, b] = new FooIterator;
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -14,11 +12,12 @@ class FooIterator {
[Symbol.iterator]() {
return this;
}
}
}
var a: Bar, b: Bar;
[a, b] = new FooIterator;
//// [iterableArrayPattern3.js]
var a, b;
[a, b] = new FooIterator;
class Bar {
}
class Foo extends Bar {
@@ -34,3 +33,5 @@ class FooIterator {
return this;
}
}
var a, b;
[a, b] = new FooIterator;
@@ -1,37 +1,26 @@
=== tests/cases/conformance/es6/destructuring/iterableArrayPattern3.ts ===
var a: Bar, b: Bar;
>a : Symbol(a, Decl(iterableArrayPattern3.ts, 0, 3))
>Bar : Symbol(Bar, Decl(iterableArrayPattern3.ts, 1, 25))
>b : Symbol(b, Decl(iterableArrayPattern3.ts, 0, 11))
>Bar : Symbol(Bar, Decl(iterableArrayPattern3.ts, 1, 25))
[a, b] = new FooIterator;
>a : Symbol(a, Decl(iterableArrayPattern3.ts, 0, 3))
>b : Symbol(b, Decl(iterableArrayPattern3.ts, 0, 11))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern3.ts, 3, 27))
class Bar { x }
>Bar : Symbol(Bar, Decl(iterableArrayPattern3.ts, 1, 25))
>x : Symbol(Bar.x, Decl(iterableArrayPattern3.ts, 2, 11))
>Bar : Symbol(Bar, Decl(iterableArrayPattern3.ts, 0, 0))
>x : Symbol(Bar.x, Decl(iterableArrayPattern3.ts, 0, 11))
class Foo extends Bar { y }
>Foo : Symbol(Foo, Decl(iterableArrayPattern3.ts, 2, 15))
>Bar : Symbol(Bar, Decl(iterableArrayPattern3.ts, 1, 25))
>y : Symbol(Foo.y, Decl(iterableArrayPattern3.ts, 3, 23))
>Foo : Symbol(Foo, Decl(iterableArrayPattern3.ts, 0, 15))
>Bar : Symbol(Bar, Decl(iterableArrayPattern3.ts, 0, 0))
>y : Symbol(Foo.y, Decl(iterableArrayPattern3.ts, 1, 23))
class FooIterator {
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern3.ts, 3, 27))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern3.ts, 1, 27))
next() {
>next : Symbol(FooIterator.next, Decl(iterableArrayPattern3.ts, 4, 19))
>next : Symbol(FooIterator.next, Decl(iterableArrayPattern3.ts, 2, 19))
return {
value: new Foo,
>value : Symbol(value, Decl(iterableArrayPattern3.ts, 6, 16))
>Foo : Symbol(Foo, Decl(iterableArrayPattern3.ts, 2, 15))
>value : Symbol(value, Decl(iterableArrayPattern3.ts, 4, 16))
>Foo : Symbol(Foo, Decl(iterableArrayPattern3.ts, 0, 15))
done: false
>done : Symbol(done, Decl(iterableArrayPattern3.ts, 7, 27))
>done : Symbol(done, Decl(iterableArrayPattern3.ts, 5, 27))
};
}
@@ -42,6 +31,18 @@ class FooIterator {
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
return this;
>this : Symbol(FooIterator, Decl(iterableArrayPattern3.ts, 3, 27))
>this : Symbol(FooIterator, Decl(iterableArrayPattern3.ts, 1, 27))
}
}
var a: Bar, b: Bar;
>a : Symbol(a, Decl(iterableArrayPattern3.ts, 15, 3))
>Bar : Symbol(Bar, Decl(iterableArrayPattern3.ts, 0, 0))
>b : Symbol(b, Decl(iterableArrayPattern3.ts, 15, 11))
>Bar : Symbol(Bar, Decl(iterableArrayPattern3.ts, 0, 0))
[a, b] = new FooIterator;
>a : Symbol(a, Decl(iterableArrayPattern3.ts, 15, 3))
>b : Symbol(b, Decl(iterableArrayPattern3.ts, 15, 11))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern3.ts, 1, 27))
@@ -1,18 +1,4 @@
=== tests/cases/conformance/es6/destructuring/iterableArrayPattern3.ts ===
var a: Bar, b: Bar;
>a : Bar
>Bar : Bar
>b : Bar
>Bar : Bar
[a, b] = new FooIterator;
>[a, b] = new FooIterator : FooIterator
>[a, b] : [Bar, Bar]
>a : Bar
>b : Bar
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
class Bar { x }
>Bar : Bar
>x : any
@@ -52,3 +38,18 @@ class FooIterator {
>this : this
}
}
var a: Bar, b: Bar;
>a : Bar
>Bar : Bar
>b : Bar
>Bar : Bar
[a, b] = new FooIterator;
>[a, b] = new FooIterator : FooIterator
>[a, b] : [Bar, Bar]
>a : Bar
>b : Bar
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
@@ -1,6 +1,4 @@
//// [iterableArrayPattern4.ts]
var a: Bar, b: Bar[];
[a, ...b] = new FooIterator;
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -14,11 +12,12 @@ class FooIterator {
[Symbol.iterator]() {
return this;
}
}
}
var a: Bar, b: Bar[];
[a, ...b] = new FooIterator
//// [iterableArrayPattern4.js]
var a, b;
[a, ...b] = new FooIterator;
class Bar {
}
class Foo extends Bar {
@@ -34,3 +33,5 @@ class FooIterator {
return this;
}
}
var a, b;
[a, ...b] = new FooIterator;
@@ -1,37 +1,26 @@
=== tests/cases/conformance/es6/destructuring/iterableArrayPattern4.ts ===
var a: Bar, b: Bar[];
>a : Symbol(a, Decl(iterableArrayPattern4.ts, 0, 3))
>Bar : Symbol(Bar, Decl(iterableArrayPattern4.ts, 1, 28))
>b : Symbol(b, Decl(iterableArrayPattern4.ts, 0, 11))
>Bar : Symbol(Bar, Decl(iterableArrayPattern4.ts, 1, 28))
[a, ...b] = new FooIterator;
>a : Symbol(a, Decl(iterableArrayPattern4.ts, 0, 3))
>b : Symbol(b, Decl(iterableArrayPattern4.ts, 0, 11))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern4.ts, 3, 27))
class Bar { x }
>Bar : Symbol(Bar, Decl(iterableArrayPattern4.ts, 1, 28))
>x : Symbol(Bar.x, Decl(iterableArrayPattern4.ts, 2, 11))
>Bar : Symbol(Bar, Decl(iterableArrayPattern4.ts, 0, 0))
>x : Symbol(Bar.x, Decl(iterableArrayPattern4.ts, 0, 11))
class Foo extends Bar { y }
>Foo : Symbol(Foo, Decl(iterableArrayPattern4.ts, 2, 15))
>Bar : Symbol(Bar, Decl(iterableArrayPattern4.ts, 1, 28))
>y : Symbol(Foo.y, Decl(iterableArrayPattern4.ts, 3, 23))
>Foo : Symbol(Foo, Decl(iterableArrayPattern4.ts, 0, 15))
>Bar : Symbol(Bar, Decl(iterableArrayPattern4.ts, 0, 0))
>y : Symbol(Foo.y, Decl(iterableArrayPattern4.ts, 1, 23))
class FooIterator {
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern4.ts, 3, 27))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern4.ts, 1, 27))
next() {
>next : Symbol(FooIterator.next, Decl(iterableArrayPattern4.ts, 4, 19))
>next : Symbol(FooIterator.next, Decl(iterableArrayPattern4.ts, 2, 19))
return {
value: new Foo,
>value : Symbol(value, Decl(iterableArrayPattern4.ts, 6, 16))
>Foo : Symbol(Foo, Decl(iterableArrayPattern4.ts, 2, 15))
>value : Symbol(value, Decl(iterableArrayPattern4.ts, 4, 16))
>Foo : Symbol(Foo, Decl(iterableArrayPattern4.ts, 0, 15))
done: false
>done : Symbol(done, Decl(iterableArrayPattern4.ts, 7, 27))
>done : Symbol(done, Decl(iterableArrayPattern4.ts, 5, 27))
};
}
@@ -42,6 +31,18 @@ class FooIterator {
>iterator : Symbol(SymbolConstructor.iterator, Decl(lib.es2015.iterable.d.ts, --, --))
return this;
>this : Symbol(FooIterator, Decl(iterableArrayPattern4.ts, 3, 27))
>this : Symbol(FooIterator, Decl(iterableArrayPattern4.ts, 1, 27))
}
}
var a: Bar, b: Bar[];
>a : Symbol(a, Decl(iterableArrayPattern4.ts, 15, 3))
>Bar : Symbol(Bar, Decl(iterableArrayPattern4.ts, 0, 0))
>b : Symbol(b, Decl(iterableArrayPattern4.ts, 15, 11))
>Bar : Symbol(Bar, Decl(iterableArrayPattern4.ts, 0, 0))
[a, ...b] = new FooIterator
>a : Symbol(a, Decl(iterableArrayPattern4.ts, 15, 3))
>b : Symbol(b, Decl(iterableArrayPattern4.ts, 15, 11))
>FooIterator : Symbol(FooIterator, Decl(iterableArrayPattern4.ts, 1, 27))
@@ -1,19 +1,4 @@
=== tests/cases/conformance/es6/destructuring/iterableArrayPattern4.ts ===
var a: Bar, b: Bar[];
>a : Bar
>Bar : Bar
>b : Bar[]
>Bar : Bar
[a, ...b] = new FooIterator;
>[a, ...b] = new FooIterator : FooIterator
>[a, ...b] : Bar[]
>a : Bar
>...b : Bar
>b : Bar[]
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
class Bar { x }
>Bar : Bar
>x : any
@@ -53,3 +38,19 @@ class FooIterator {
>this : this
}
}
var a: Bar, b: Bar[];
>a : Bar
>Bar : Bar
>b : Bar[]
>Bar : Bar
[a, ...b] = new FooIterator
>[a, ...b] = new FooIterator : FooIterator
>[a, ...b] : Bar[]
>a : Bar
>...b : Bar
>b : Bar[]
>new FooIterator : FooIterator
>FooIterator : typeof FooIterator
@@ -1,11 +1,7 @@
tests/cases/conformance/es6/destructuring/iterableArrayPattern5.ts(2,5): error TS2322: Type 'Foo' is not assignable to type 'string'.
tests/cases/conformance/es6/destructuring/iterableArrayPattern5.ts(17,5): error TS2322: Type 'Foo' is not assignable to type 'string'.
==== tests/cases/conformance/es6/destructuring/iterableArrayPattern5.ts (1 errors) ====
var a: Bar, b: string;
[a, b] = new FooIterator;
~
!!! error TS2322: Type 'Foo' is not assignable to type 'string'.
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -19,4 +15,9 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern5.ts(2,5): error T
[Symbol.iterator]() {
return this;
}
}
}
var a: Bar, b: string;
[a, b] = new FooIterator;
~
!!! error TS2322: Type 'Foo' is not assignable to type 'string'.
@@ -1,6 +1,4 @@
//// [iterableArrayPattern5.ts]
var a: Bar, b: string;
[a, b] = new FooIterator;
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -14,11 +12,12 @@ class FooIterator {
[Symbol.iterator]() {
return this;
}
}
}
var a: Bar, b: string;
[a, b] = new FooIterator;
//// [iterableArrayPattern5.js]
var a, b;
[a, b] = new FooIterator;
class Bar {
}
class Foo extends Bar {
@@ -34,3 +33,5 @@ class FooIterator {
return this;
}
}
var a, b;
[a, b] = new FooIterator;
@@ -1,13 +1,8 @@
tests/cases/conformance/es6/destructuring/iterableArrayPattern6.ts(2,8): error TS2322: Type 'Foo[]' is not assignable to type 'string[]'.
tests/cases/conformance/es6/destructuring/iterableArrayPattern6.ts(17,8): error TS2322: Type 'Foo[]' is not assignable to type 'string[]'.
Type 'Foo' is not assignable to type 'string'.
==== tests/cases/conformance/es6/destructuring/iterableArrayPattern6.ts (1 errors) ====
var a: Bar, b: string[];
[a, ...b] = new FooIterator;
~
!!! error TS2322: Type 'Foo[]' is not assignable to type 'string[]'.
!!! error TS2322: Type 'Foo' is not assignable to type 'string'.
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -21,4 +16,10 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern6.ts(2,8): error T
[Symbol.iterator]() {
return this;
}
}
}
var a: Bar, b: string[];
[a, ...b] = new FooIterator;
~
!!! error TS2322: Type 'Foo[]' is not assignable to type 'string[]'.
!!! error TS2322: Type 'Foo' is not assignable to type 'string'.
@@ -1,6 +1,4 @@
//// [iterableArrayPattern6.ts]
var a: Bar, b: string[];
[a, ...b] = new FooIterator;
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -14,11 +12,12 @@ class FooIterator {
[Symbol.iterator]() {
return this;
}
}
}
var a: Bar, b: string[];
[a, ...b] = new FooIterator;
//// [iterableArrayPattern6.js]
var a, b;
[a, ...b] = new FooIterator;
class Bar {
}
class Foo extends Bar {
@@ -34,3 +33,5 @@ class FooIterator {
return this;
}
}
var a, b;
[a, ...b] = new FooIterator;
@@ -1,13 +1,8 @@
tests/cases/conformance/es6/destructuring/iterableArrayPattern7.ts(2,5): error TS2322: Type 'Foo' is not assignable to type 'string[]'.
tests/cases/conformance/es6/destructuring/iterableArrayPattern7.ts(17,5): error TS2322: Type 'Foo' is not assignable to type 'string[]'.
Property 'length' is missing in type 'Foo'.
==== tests/cases/conformance/es6/destructuring/iterableArrayPattern7.ts (1 errors) ====
var a: Bar, b: string[];
[a, b] = new FooIterator;
~
!!! error TS2322: Type 'Foo' is not assignable to type 'string[]'.
!!! error TS2322: Property 'length' is missing in type 'Foo'.
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -21,4 +16,10 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern7.ts(2,5): error T
[Symbol.iterator]() {
return this;
}
}
}
var a: Bar, b: string[];
[a, b] = new FooIterator;
~
!!! error TS2322: Type 'Foo' is not assignable to type 'string[]'.
!!! error TS2322: Property 'length' is missing in type 'Foo'.
@@ -1,6 +1,4 @@
//// [iterableArrayPattern7.ts]
var a: Bar, b: string[];
[a, b] = new FooIterator;
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -14,11 +12,12 @@ class FooIterator {
[Symbol.iterator]() {
return this;
}
}
}
var a: Bar, b: string[];
[a, b] = new FooIterator;
//// [iterableArrayPattern7.js]
var a, b;
[a, b] = new FooIterator;
class Bar {
}
class Foo extends Bar {
@@ -34,3 +33,5 @@ class FooIterator {
return this;
}
}
var a, b;
[a, b] = new FooIterator;
@@ -1,11 +1,7 @@
tests/cases/conformance/es6/destructuring/iterableArrayPattern8.ts(2,8): error TS2322: Type 'Foo[]' is not assignable to type 'string'.
tests/cases/conformance/es6/destructuring/iterableArrayPattern8.ts(17,8): error TS2322: Type 'Foo[]' is not assignable to type 'string'.
==== tests/cases/conformance/es6/destructuring/iterableArrayPattern8.ts (1 errors) ====
var a: Bar, b: string;
[a, ...b] = new FooIterator;
~
!!! error TS2322: Type 'Foo[]' is not assignable to type 'string'.
class Bar { x }
class Foo extends Bar { y }
class FooIterator {
@@ -19,4 +15,9 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern8.ts(2,8): error T
[Symbol.iterator]() {
return this;
}
}
}
var a: Bar, b: string;
[a, ...b] = new FooIterator;
~
!!! error TS2322: Type 'Foo[]' is not assignable to type 'string'.

Some files were not shown because too many files have changed in this diff Show More