-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accept correct baselines for symbol property tests
- Loading branch information
1 parent
779661c
commit 95af997
Showing
78 changed files
with
1,830 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; }'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
Oops, something went wrong.
95af997
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍