Skip to content

Commit 95af997

Browse files
committed
Accept correct baselines for symbol property tests
1 parent 779661c commit 95af997

File tree

78 files changed

+1830
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1830
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
tests/cases/conformance/es6/Symbols/symbolProperty10.ts(10,5): error TS2322: Type 'I' is not assignable to type 'C'.
2+
Types of property '[Symbol.iterator]' are incompatible.
3+
Type '{ x: any; }' is not assignable to type '{ x: any; y: any; }'.
4+
Property 'y' is missing in type '{ x: any; }'.
5+
6+
7+
==== tests/cases/conformance/es6/Symbols/symbolProperty10.ts (1 errors) ====
8+
class C {
9+
[Symbol.iterator]: { x; y };
10+
}
11+
interface I {
12+
[Symbol.iterator]?: { x };
13+
}
14+
15+
var i: I;
16+
i = new C;
17+
var c: C = i;
18+
~
19+
!!! error TS2322: Type 'I' is not assignable to type 'C'.
20+
!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible.
21+
!!! error TS2322: Type '{ x: any; }' is not assignable to type '{ x: any; y: any; }'.
22+
!!! error TS2322: Property 'y' is missing in type '{ x: any; }'.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//// [symbolProperty10.ts]
2+
class C {
3+
[Symbol.iterator]: { x; y };
4+
}
5+
interface I {
6+
[Symbol.iterator]?: { x };
7+
}
8+
9+
var i: I;
10+
i = new C;
11+
var c: C = i;
12+
13+
//// [symbolProperty10.js]
14+
var C = (function () {
15+
function C() {
16+
}
17+
return C;
18+
})();
19+
var i;
20+
i = new C;
21+
var c = i;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//// [symbolProperty11.ts]
2+
class C { }
3+
interface I {
4+
[Symbol.iterator]?: { x };
5+
}
6+
7+
var i: I;
8+
i = new C;
9+
var c: C = i;
10+
11+
//// [symbolProperty11.js]
12+
var C = (function () {
13+
function C() {
14+
}
15+
return C;
16+
})();
17+
var i;
18+
i = new C;
19+
var c = i;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
=== tests/cases/conformance/es6/Symbols/symbolProperty11.ts ===
2+
class C { }
3+
>C : C
4+
5+
interface I {
6+
>I : I
7+
8+
[Symbol.iterator]?: { x };
9+
>Symbol.iterator : Symbol
10+
>Symbol : SymbolConstructor
11+
>iterator : Symbol
12+
>x : any
13+
}
14+
15+
var i: I;
16+
>i : I
17+
>I : I
18+
19+
i = new C;
20+
>i = new C : C
21+
>i : I
22+
>new C : C
23+
>C : typeof C
24+
25+
var c: C = i;
26+
>c : C
27+
>C : C
28+
>i : I
29+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
tests/cases/conformance/es6/Symbols/symbolProperty12.ts(9,1): error TS2322: Type 'C' is not assignable to type 'I'.
2+
Property '[Symbol.iterator]' is private in type 'C' but not in type 'I'.
3+
tests/cases/conformance/es6/Symbols/symbolProperty12.ts(10,5): error TS2322: Type 'I' is not assignable to type 'C'.
4+
Property '[Symbol.iterator]' is private in type 'C' but not in type 'I'.
5+
6+
7+
==== tests/cases/conformance/es6/Symbols/symbolProperty12.ts (2 errors) ====
8+
class C {
9+
private [Symbol.iterator]: { x };
10+
}
11+
interface I {
12+
[Symbol.iterator]: { x };
13+
}
14+
15+
var i: I;
16+
i = new C;
17+
~
18+
!!! error TS2322: Type 'C' is not assignable to type 'I'.
19+
!!! error TS2322: Property '[Symbol.iterator]' is private in type 'C' but not in type 'I'.
20+
var c: C = i;
21+
~
22+
!!! error TS2322: Type 'I' is not assignable to type 'C'.
23+
!!! error TS2322: Property '[Symbol.iterator]' is private in type 'C' but not in type 'I'.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//// [symbolProperty12.ts]
2+
class C {
3+
private [Symbol.iterator]: { x };
4+
}
5+
interface I {
6+
[Symbol.iterator]: { x };
7+
}
8+
9+
var i: I;
10+
i = new C;
11+
var c: C = i;
12+
13+
//// [symbolProperty12.js]
14+
var C = (function () {
15+
function C() {
16+
}
17+
return C;
18+
})();
19+
var i;
20+
i = new C;
21+
var c = i;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//// [symbolProperty13.ts]
2+
class C {
3+
[Symbol.iterator]: { x; y };
4+
}
5+
interface I {
6+
[Symbol.iterator]: { x };
7+
}
8+
9+
declare function foo(i: I): I;
10+
declare function foo(a: any): any;
11+
12+
declare function bar(i: C): C;
13+
declare function bar(a: any): any;
14+
15+
foo(new C);
16+
var i: I;
17+
bar(i);
18+
19+
//// [symbolProperty13.js]
20+
var C = (function () {
21+
function C() {
22+
}
23+
return C;
24+
})();
25+
foo(new C);
26+
var i;
27+
bar(i);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
=== tests/cases/conformance/es6/Symbols/symbolProperty13.ts ===
2+
class C {
3+
>C : C
4+
5+
[Symbol.iterator]: { x; y };
6+
>Symbol.iterator : Symbol
7+
>Symbol : SymbolConstructor
8+
>iterator : Symbol
9+
>x : any
10+
>y : any
11+
}
12+
interface I {
13+
>I : I
14+
15+
[Symbol.iterator]: { x };
16+
>Symbol.iterator : Symbol
17+
>Symbol : SymbolConstructor
18+
>iterator : Symbol
19+
>x : any
20+
}
21+
22+
declare function foo(i: I): I;
23+
>foo : { (i: I): I; (a: any): any; }
24+
>i : I
25+
>I : I
26+
>I : I
27+
28+
declare function foo(a: any): any;
29+
>foo : { (i: I): I; (a: any): any; }
30+
>a : any
31+
32+
declare function bar(i: C): C;
33+
>bar : { (i: C): C; (a: any): any; }
34+
>i : C
35+
>C : C
36+
>C : C
37+
38+
declare function bar(a: any): any;
39+
>bar : { (i: C): C; (a: any): any; }
40+
>a : any
41+
42+
foo(new C);
43+
>foo(new C) : I
44+
>foo : { (i: I): I; (a: any): any; }
45+
>new C : C
46+
>C : typeof C
47+
48+
var i: I;
49+
>i : I
50+
>I : I
51+
52+
bar(i);
53+
>bar(i) : any
54+
>bar : { (i: C): C; (a: any): any; }
55+
>i : I
56+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//// [symbolProperty14.ts]
2+
class C {
3+
[Symbol.iterator]: { x; y };
4+
}
5+
interface I {
6+
[Symbol.iterator]?: { x };
7+
}
8+
9+
declare function foo(i: I): I;
10+
declare function foo(a: any): any;
11+
12+
declare function bar(i: C): C;
13+
declare function bar(a: any): any;
14+
15+
foo(new C);
16+
var i: I;
17+
bar(i);
18+
19+
//// [symbolProperty14.js]
20+
var C = (function () {
21+
function C() {
22+
}
23+
return C;
24+
})();
25+
foo(new C);
26+
var i;
27+
bar(i);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
=== tests/cases/conformance/es6/Symbols/symbolProperty14.ts ===
2+
class C {
3+
>C : C
4+
5+
[Symbol.iterator]: { x; y };
6+
>Symbol.iterator : Symbol
7+
>Symbol : SymbolConstructor
8+
>iterator : Symbol
9+
>x : any
10+
>y : any
11+
}
12+
interface I {
13+
>I : I
14+
15+
[Symbol.iterator]?: { x };
16+
>Symbol.iterator : Symbol
17+
>Symbol : SymbolConstructor
18+
>iterator : Symbol
19+
>x : any
20+
}
21+
22+
declare function foo(i: I): I;
23+
>foo : { (i: I): I; (a: any): any; }
24+
>i : I
25+
>I : I
26+
>I : I
27+
28+
declare function foo(a: any): any;
29+
>foo : { (i: I): I; (a: any): any; }
30+
>a : any
31+
32+
declare function bar(i: C): C;
33+
>bar : { (i: C): C; (a: any): any; }
34+
>i : C
35+
>C : C
36+
>C : C
37+
38+
declare function bar(a: any): any;
39+
>bar : { (i: C): C; (a: any): any; }
40+
>a : any
41+
42+
foo(new C);
43+
>foo(new C) : I
44+
>foo : { (i: I): I; (a: any): any; }
45+
>new C : C
46+
>C : typeof C
47+
48+
var i: I;
49+
>i : I
50+
>I : I
51+
52+
bar(i);
53+
>bar(i) : any
54+
>bar : { (i: C): C; (a: any): any; }
55+
>i : I
56+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//// [symbolProperty15.ts]
2+
class C { }
3+
interface I {
4+
[Symbol.iterator]?: { x };
5+
}
6+
7+
declare function foo(i: I): I;
8+
declare function foo(a: any): any;
9+
10+
declare function bar(i: C): C;
11+
declare function bar(a: any): any;
12+
13+
foo(new C);
14+
var i: I;
15+
bar(i);
16+
17+
//// [symbolProperty15.js]
18+
var C = (function () {
19+
function C() {
20+
}
21+
return C;
22+
})();
23+
foo(new C);
24+
var i;
25+
bar(i);
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
=== tests/cases/conformance/es6/Symbols/symbolProperty15.ts ===
2+
class C { }
3+
>C : C
4+
5+
interface I {
6+
>I : I
7+
8+
[Symbol.iterator]?: { x };
9+
>Symbol.iterator : Symbol
10+
>Symbol : SymbolConstructor
11+
>iterator : Symbol
12+
>x : any
13+
}
14+
15+
declare function foo(i: I): I;
16+
>foo : { (i: I): I; (a: any): any; }
17+
>i : I
18+
>I : I
19+
>I : I
20+
21+
declare function foo(a: any): any;
22+
>foo : { (i: I): I; (a: any): any; }
23+
>a : any
24+
25+
declare function bar(i: C): C;
26+
>bar : { (i: C): C; (a: any): any; }
27+
>i : C
28+
>C : C
29+
>C : C
30+
31+
declare function bar(a: any): any;
32+
>bar : { (i: C): C; (a: any): any; }
33+
>a : any
34+
35+
foo(new C);
36+
>foo(new C) : any
37+
>foo : { (i: I): I; (a: any): any; }
38+
>new C : C
39+
>C : typeof C
40+
41+
var i: I;
42+
>i : I
43+
>I : I
44+
45+
bar(i);
46+
>bar(i) : C
47+
>bar : { (i: C): C; (a: any): any; }
48+
>i : I
49+

0 commit comments

Comments
 (0)