Skip to content

Commit

Permalink
Accept correct baselines for symbol property tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JsonFreeman committed Feb 7, 2015
1 parent 779661c commit 95af997
Show file tree
Hide file tree
Showing 78 changed files with 1,830 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/baselines/reference/symbolProperty10.errors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
tests/cases/conformance/es6/Symbols/symbolProperty10.ts(10,5): error TS2322: Type 'I' is not assignable to type 'C'.
Types of property '[Symbol.iterator]' are incompatible.
Type '{ x: any; }' is not assignable to type '{ x: any; y: any; }'.
Property 'y' is missing in type '{ x: any; }'.


==== tests/cases/conformance/es6/Symbols/symbolProperty10.ts (1 errors) ====
class C {
[Symbol.iterator]: { x; y };
}
interface I {
[Symbol.iterator]?: { x };
}

var i: I;
i = new C;
var c: C = i;
~
!!! error TS2322: Type 'I' is not assignable to type 'C'.
!!! error TS2322: Types of property '[Symbol.iterator]' are incompatible.
!!! error TS2322: Type '{ x: any; }' is not assignable to type '{ x: any; y: any; }'.
!!! error TS2322: Property 'y' is missing in type '{ x: any; }'.
21 changes: 21 additions & 0 deletions tests/baselines/reference/symbolProperty10.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//// [symbolProperty10.ts]
class C {
[Symbol.iterator]: { x; y };
}
interface I {
[Symbol.iterator]?: { x };
}

var i: I;
i = new C;
var c: C = i;

//// [symbolProperty10.js]
var C = (function () {
function C() {
}
return C;
})();
var i;
i = new C;
var c = i;
19 changes: 19 additions & 0 deletions tests/baselines/reference/symbolProperty11.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//// [symbolProperty11.ts]
class C { }
interface I {
[Symbol.iterator]?: { x };
}

var i: I;
i = new C;
var c: C = i;

//// [symbolProperty11.js]
var C = (function () {
function C() {
}
return C;
})();
var i;
i = new C;
var c = i;
29 changes: 29 additions & 0 deletions tests/baselines/reference/symbolProperty11.types
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
=== tests/cases/conformance/es6/Symbols/symbolProperty11.ts ===
class C { }
>C : C

interface I {
>I : I

[Symbol.iterator]?: { x };
>Symbol.iterator : Symbol
>Symbol : SymbolConstructor
>iterator : Symbol
>x : any
}

var i: I;
>i : I
>I : I

i = new C;
>i = new C : C
>i : I
>new C : C
>C : typeof C

var c: C = i;
>c : C
>C : C
>i : I

23 changes: 23 additions & 0 deletions tests/baselines/reference/symbolProperty12.errors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
tests/cases/conformance/es6/Symbols/symbolProperty12.ts(9,1): error TS2322: Type 'C' is not assignable to type 'I'.
Property '[Symbol.iterator]' is private in type 'C' but not in type 'I'.
tests/cases/conformance/es6/Symbols/symbolProperty12.ts(10,5): error TS2322: Type 'I' is not assignable to type 'C'.
Property '[Symbol.iterator]' is private in type 'C' but not in type 'I'.


==== tests/cases/conformance/es6/Symbols/symbolProperty12.ts (2 errors) ====
class C {
private [Symbol.iterator]: { x };
}
interface I {
[Symbol.iterator]: { x };
}

var i: I;
i = new C;
~
!!! error TS2322: Type 'C' is not assignable to type 'I'.
!!! error TS2322: Property '[Symbol.iterator]' is private in type 'C' but not in type 'I'.
var c: C = i;
~
!!! error TS2322: Type 'I' is not assignable to type 'C'.
!!! error TS2322: Property '[Symbol.iterator]' is private in type 'C' but not in type 'I'.
21 changes: 21 additions & 0 deletions tests/baselines/reference/symbolProperty12.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//// [symbolProperty12.ts]
class C {
private [Symbol.iterator]: { x };
}
interface I {
[Symbol.iterator]: { x };
}

var i: I;
i = new C;
var c: C = i;

//// [symbolProperty12.js]
var C = (function () {
function C() {
}
return C;
})();
var i;
i = new C;
var c = i;
27 changes: 27 additions & 0 deletions tests/baselines/reference/symbolProperty13.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//// [symbolProperty13.ts]
class C {
[Symbol.iterator]: { x; y };
}
interface I {
[Symbol.iterator]: { x };
}

declare function foo(i: I): I;
declare function foo(a: any): any;

declare function bar(i: C): C;
declare function bar(a: any): any;

foo(new C);
var i: I;
bar(i);

//// [symbolProperty13.js]
var C = (function () {
function C() {
}
return C;
})();
foo(new C);
var i;
bar(i);
56 changes: 56 additions & 0 deletions tests/baselines/reference/symbolProperty13.types
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
=== tests/cases/conformance/es6/Symbols/symbolProperty13.ts ===
class C {
>C : C

[Symbol.iterator]: { x; y };
>Symbol.iterator : Symbol
>Symbol : SymbolConstructor
>iterator : Symbol
>x : any
>y : any
}
interface I {
>I : I

[Symbol.iterator]: { x };
>Symbol.iterator : Symbol
>Symbol : SymbolConstructor
>iterator : Symbol
>x : any
}

declare function foo(i: I): I;
>foo : { (i: I): I; (a: any): any; }
>i : I
>I : I
>I : I

declare function foo(a: any): any;
>foo : { (i: I): I; (a: any): any; }
>a : any

declare function bar(i: C): C;
>bar : { (i: C): C; (a: any): any; }
>i : C
>C : C
>C : C

declare function bar(a: any): any;
>bar : { (i: C): C; (a: any): any; }
>a : any

foo(new C);
>foo(new C) : I
>foo : { (i: I): I; (a: any): any; }
>new C : C
>C : typeof C

var i: I;
>i : I
>I : I

bar(i);
>bar(i) : any
>bar : { (i: C): C; (a: any): any; }
>i : I

27 changes: 27 additions & 0 deletions tests/baselines/reference/symbolProperty14.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//// [symbolProperty14.ts]
class C {
[Symbol.iterator]: { x; y };
}
interface I {
[Symbol.iterator]?: { x };
}

declare function foo(i: I): I;
declare function foo(a: any): any;

declare function bar(i: C): C;
declare function bar(a: any): any;

foo(new C);
var i: I;
bar(i);

//// [symbolProperty14.js]
var C = (function () {
function C() {
}
return C;
})();
foo(new C);
var i;
bar(i);
56 changes: 56 additions & 0 deletions tests/baselines/reference/symbolProperty14.types
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
=== tests/cases/conformance/es6/Symbols/symbolProperty14.ts ===
class C {
>C : C

[Symbol.iterator]: { x; y };
>Symbol.iterator : Symbol
>Symbol : SymbolConstructor
>iterator : Symbol
>x : any
>y : any
}
interface I {
>I : I

[Symbol.iterator]?: { x };
>Symbol.iterator : Symbol
>Symbol : SymbolConstructor
>iterator : Symbol
>x : any
}

declare function foo(i: I): I;
>foo : { (i: I): I; (a: any): any; }
>i : I
>I : I
>I : I

declare function foo(a: any): any;
>foo : { (i: I): I; (a: any): any; }
>a : any

declare function bar(i: C): C;
>bar : { (i: C): C; (a: any): any; }
>i : C
>C : C
>C : C

declare function bar(a: any): any;
>bar : { (i: C): C; (a: any): any; }
>a : any

foo(new C);
>foo(new C) : I
>foo : { (i: I): I; (a: any): any; }
>new C : C
>C : typeof C

var i: I;
>i : I
>I : I

bar(i);
>bar(i) : any
>bar : { (i: C): C; (a: any): any; }
>i : I

25 changes: 25 additions & 0 deletions tests/baselines/reference/symbolProperty15.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//// [symbolProperty15.ts]
class C { }
interface I {
[Symbol.iterator]?: { x };
}

declare function foo(i: I): I;
declare function foo(a: any): any;

declare function bar(i: C): C;
declare function bar(a: any): any;

foo(new C);
var i: I;
bar(i);

//// [symbolProperty15.js]
var C = (function () {
function C() {
}
return C;
})();
foo(new C);
var i;
bar(i);
49 changes: 49 additions & 0 deletions tests/baselines/reference/symbolProperty15.types
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
=== tests/cases/conformance/es6/Symbols/symbolProperty15.ts ===
class C { }
>C : C

interface I {
>I : I

[Symbol.iterator]?: { x };
>Symbol.iterator : Symbol
>Symbol : SymbolConstructor
>iterator : Symbol
>x : any
}

declare function foo(i: I): I;
>foo : { (i: I): I; (a: any): any; }
>i : I
>I : I
>I : I

declare function foo(a: any): any;
>foo : { (i: I): I; (a: any): any; }
>a : any

declare function bar(i: C): C;
>bar : { (i: C): C; (a: any): any; }
>i : C
>C : C
>C : C

declare function bar(a: any): any;
>bar : { (i: C): C; (a: any): any; }
>a : any

foo(new C);
>foo(new C) : any
>foo : { (i: I): I; (a: any): any; }
>new C : C
>C : typeof C

var i: I;
>i : I
>I : I

bar(i);
>bar(i) : C
>bar : { (i: C): C; (a: any): any; }
>i : I

Loading

1 comment on commit 95af997

@yuit
Copy link
Contributor

@yuit yuit commented on 95af997 Feb 10, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.