Merge branch 'master' into es6Typings

This commit is contained in:
Mohamed Hegazy
2014-11-27 10:00:32 -08:00
279 changed files with 8016 additions and 5053 deletions

View File

@@ -1,9 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName10_es6.ts(2,8): error TS1005: ';' expected.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName10_es6.ts (1 errors) ====
class C {
[e] = 1
~
!!! error TS1005: ';' expected.
}

View File

@@ -1,15 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName11_es6.ts(2,7): error TS1005: ';' expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName11_es6.ts(2,8): error TS1109: Expression expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName11_es6.ts(3,1): error TS1128: Declaration or statement expected.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName11_es6.ts (3 errors) ====
class C {
[e]();
~
!!! error TS1005: ';' expected.
~
!!! error TS1109: Expression expected.
}
~
!!! error TS1128: Declaration or statement expected.

View File

@@ -1,15 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName12_es6.ts(2,7): error TS1005: ';' expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName12_es6.ts(2,10): error TS1005: '=>' expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName12_es6.ts(3,1): error TS1128: Declaration or statement expected.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName12_es6.ts (3 errors) ====
class C {
[e]() { }
~
!!! error TS1005: ';' expected.
~
!!! error TS1005: '=>' expected.
}
~
!!! error TS1128: Declaration or statement expected.

View File

@@ -1,7 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName13_es6.ts(1,11): error TS1022: An index signature parameter must have a type annotation.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName13_es6.ts (1 errors) ====
var v: { [e]: number };
~
!!! error TS1022: An index signature parameter must have a type annotation.

View File

@@ -1,7 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName14_es6.ts(1,13): error TS1005: ';' expected.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName14_es6.ts (1 errors) ====
var v: { [e](): number };
~
!!! error TS1005: ';' expected.

View File

@@ -1,7 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName15_es6.ts(1,32): error TS1022: An index signature parameter must have a type annotation.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName15_es6.ts (1 errors) ====
var v: { [e: number]: string; [e]: number };
~
!!! error TS1022: An index signature parameter must have a type annotation.

View File

@@ -1,18 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName16_es6.ts(2,3): error TS1132: Enum member expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName16_es6.ts(3,1): error TS1128: Declaration or statement expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName16_es6.ts(2,3): error TS2364: Invalid left-hand side of assignment expression.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName16_es6.ts(2,4): error TS2304: Cannot find name 'e'.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName16_es6.ts (4 errors) ====
enum E {
[e] = 1
~
!!! error TS1132: Enum member expected.
~~~
!!! error TS2364: Invalid left-hand side of assignment expression.
~
!!! error TS2304: Cannot find name 'e'.
}
~
!!! error TS1128: Declaration or statement expected.

View File

@@ -1,16 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName17_es6.ts(1,15): error TS1003: Identifier expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName17_es6.ts(1,22): error TS1005: ',' expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName17_es6.ts(1,26): error TS1128: Declaration or statement expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName17_es6.ts(1,16): error TS2304: Cannot find name 'e'.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName17_es6.ts (4 errors) ====
var v = { set [e](v) { } }
~
!!! error TS1003: Identifier expected.
~
!!! error TS1005: ',' expected.
~
!!! error TS1128: Declaration or statement expected.
~
!!! error TS2304: Cannot find name 'e'.

View File

@@ -1,7 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName18_es6.ts(1,13): error TS1005: ';' expected.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName18_es6.ts (1 errors) ====
var v: { [e]?(): number };
~
!!! error TS1005: ';' expected.

View File

@@ -1,7 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName19_es6.ts(1,13): error TS1005: ';' expected.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName19_es6.ts (1 errors) ====
var v: { [e]? };
~
!!! error TS1005: ';' expected.

View File

@@ -1,13 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName1_es6.ts(1,11): error TS1136: Property assignment expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName1_es6.ts(1,15): error TS1128: Declaration or statement expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName1_es6.ts(1,12): error TS2304: Cannot find name 'e'.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName1_es6.ts (3 errors) ====
var v = { [e] };
~
!!! error TS1136: Property assignment expected.
~
!!! error TS1128: Declaration or statement expected.
~
!!! error TS2304: Cannot find name 'e'.

View File

@@ -1,19 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts(1,11): error TS1136: Property assignment expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts(1,14): error TS1005: ',' expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts(1,16): error TS1134: Variable declaration expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts(1,18): error TS1128: Declaration or statement expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts(1,12): error TS2304: Cannot find name 'e'.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName2_es6.ts (5 errors) ====
var v = { [e]: 1 };
~
!!! error TS1136: Property assignment expected.
~
!!! error TS1005: ',' expected.
~
!!! error TS1134: Variable declaration expected.
~
!!! error TS1128: Declaration or statement expected.
~
!!! error TS2304: Cannot find name 'e'.

View File

@@ -1,16 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName3_es6.ts(1,11): error TS1136: Property assignment expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName3_es6.ts(1,17): error TS1005: ',' expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName3_es6.ts(1,21): error TS1128: Declaration or statement expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName3_es6.ts(1,12): error TS2304: Cannot find name 'e'.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName3_es6.ts (4 errors) ====
var v = { [e]() { } };
~
!!! error TS1136: Property assignment expected.
~
!!! error TS1005: ',' expected.
~
!!! error TS1128: Declaration or statement expected.
~
!!! error TS2304: Cannot find name 'e'.

View File

@@ -1,16 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName4_es6.ts(1,15): error TS1003: Identifier expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName4_es6.ts(1,21): error TS1005: ',' expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName4_es6.ts(1,25): error TS1128: Declaration or statement expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName4_es6.ts(1,16): error TS2304: Cannot find name 'e'.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName4_es6.ts (4 errors) ====
var v = { get [e]() { } };
~
!!! error TS1003: Identifier expected.
~
!!! error TS1005: ',' expected.
~
!!! error TS1128: Declaration or statement expected.
~
!!! error TS2304: Cannot find name 'e'.

View File

@@ -1,19 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts(1,18): error TS1005: ':' expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts(1,28): error TS1005: ',' expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts(1,32): error TS1128: Declaration or statement expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts(1,18): error TS2304: Cannot find name 'get'.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts(1,23): error TS2304: Cannot find name 'e'.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName5_es6.ts (5 errors) ====
var v = { public get [e]() { } };
~~~
!!! error TS1005: ':' expected.
~
!!! error TS1005: ',' expected.
~
!!! error TS1128: Declaration or statement expected.
~~~
!!! error TS2304: Cannot find name 'get'.
~
!!! error TS2304: Cannot find name 'e'.

View File

@@ -1,28 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,11): error TS1136: Property assignment expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,14): error TS1005: ',' expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,16): error TS1134: Variable declaration expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,26): error TS1005: ';' expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,30): error TS1128: Declaration or statement expected.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,12): error TS2304: Cannot find name 'e'.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,20): error TS2304: Cannot find name 'e'.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts(1,24): error TS2304: Cannot find name 'e'.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName6_es6.ts (8 errors) ====
var v = { [e]: 1, [e + e]: 2 };
~
!!! error TS1136: Property assignment expected.
~
!!! error TS1005: ',' expected.
~
!!! error TS1134: Variable declaration expected.
~
!!! error TS1005: ';' expected.
~
!!! error TS1128: Declaration or statement expected.
~
!!! error TS2304: Cannot find name 'e'.
~
!!! error TS2304: Cannot find name 'e'.
~
!!! error TS2304: Cannot find name 'e'.

View File

@@ -1,9 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName7_es6.ts(2,5): error TS1022: An index signature parameter must have a type annotation.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName7_es6.ts (1 errors) ====
class C {
[e]
~
!!! error TS1022: An index signature parameter must have a type annotation.
}

View File

@@ -1,9 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName8_es6.ts(2,12): error TS1022: An index signature parameter must have a type annotation.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName8_es6.ts (1 errors) ====
class C {
public [e]
~
!!! error TS1022: An index signature parameter must have a type annotation.
}

View File

@@ -1,12 +0,0 @@
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName9_es6.ts(2,5): error TS1022: An index signature parameter must have a type annotation.
tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName9_es6.ts(2,9): error TS2304: Cannot find name 'Type'.
==== tests/cases/conformance/es6/computedPropertyNames/ComputedPropertyName9_es6.ts (2 errors) ====
class C {
[e]: Type
~
!!! error TS1022: An index signature parameter must have a type annotation.
~~~~
!!! error TS2304: Cannot find name 'Type'.
}

View File

@@ -0,0 +1,8 @@
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts(1,10): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts (1 errors) ====
function * foo(a = yield => yield) {
~
!!! error TS9001: 'generators' are not currently supported.
}

View File

@@ -1,8 +0,0 @@
//// [FunctionDeclaration10_es6.ts]
function * foo(a = yield => yield) {
}
//// [FunctionDeclaration10_es6.js]
function foo(a) {
if (a === void 0) { a = function (yield) { return yield; }; }
}

View File

@@ -1,8 +0,0 @@
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts ===
function * foo(a = yield => yield) {
>foo : (a?: (yield: any) => any) => void
>a : (yield: any) => any
>yield => yield : (yield: any) => any
>yield : any
>yield : any
}

View File

@@ -0,0 +1,8 @@
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts(1,10): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts (1 errors) ====
function * yield() {
~
!!! error TS9001: 'generators' are not currently supported.
}

View File

@@ -1,7 +0,0 @@
//// [FunctionDeclaration11_es6.ts]
function * yield() {
}
//// [FunctionDeclaration11_es6.js]
function yield() {
}

View File

@@ -1,4 +0,0 @@
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts ===
function * yield() {
>yield : () => void
}

View File

@@ -1,8 +1,11 @@
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(1,10): error TS9001: 'generators' are not currently supported.
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(3,11): error TS2304: Cannot find name 'yield'.
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts (1 errors) ====
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts (2 errors) ====
function * foo() {
~
!!! error TS9001: 'generators' are not currently supported.
// Legal to use 'yield' in a type context.
var v: yield;
~~~~~

View File

@@ -1,12 +0,0 @@
//// [FunctionDeclaration13_es6.ts]
function * foo() {
// Legal to use 'yield' in a type context.
var v: yield;
}
//// [FunctionDeclaration13_es6.js]
function foo() {
// Legal to use 'yield' in a type context.
var v;
}

View File

@@ -0,0 +1,8 @@
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts(1,10): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts (1 errors) ====
function * foo() {
~
!!! error TS9001: 'generators' are not currently supported.
}

View File

@@ -1,7 +0,0 @@
//// [FunctionDeclaration1_es6.ts]
function * foo() {
}
//// [FunctionDeclaration1_es6.js]
function foo() {
}

View File

@@ -1,4 +0,0 @@
=== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts ===
function * foo() {
>foo : () => void
}

View File

@@ -1,8 +1,11 @@
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,9): error TS9001: 'generators' are not currently supported.
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,18): error TS2304: Cannot find name 'yield'.
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts (1 errors) ====
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts (2 errors) ====
function*foo(a = yield) {
~
!!! error TS9001: 'generators' are not currently supported.
~~~~~
!!! error TS2304: Cannot find name 'yield'.
}

View File

@@ -1,8 +0,0 @@
//// [FunctionDeclaration6_es6.ts]
function*foo(a = yield) {
}
//// [FunctionDeclaration6_es6.js]
function foo(a) {
if (a === void 0) { a = yield; }
}

View File

@@ -1,8 +1,11 @@
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(1,9): error TS9001: 'generators' are not currently supported.
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(3,20): error TS2304: Cannot find name 'yield'.
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts (1 errors) ====
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts (2 errors) ====
function*bar() {
~
!!! error TS9001: 'generators' are not currently supported.
// 'yield' here is an identifier, and not a yield expression.
function*foo(a = yield) {
~~~~~

View File

@@ -1,14 +0,0 @@
//// [FunctionDeclaration7_es6.ts]
function*bar() {
// 'yield' here is an identifier, and not a yield expression.
function*foo(a = yield) {
}
}
//// [FunctionDeclaration7_es6.js]
function bar() {
// 'yield' here is an identifier, and not a yield expression.
function foo(a) {
if (a === void 0) { a = yield; }
}
}

View File

@@ -1,16 +1,7 @@
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts(1,11): error TS1136: Property assignment expected.
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts(1,18): error TS1005: ',' expected.
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts(1,24): error TS1128: Declaration or statement expected.
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts(1,12): error TS2304: Cannot find name 'yield'.
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts(1,11): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts (4 errors) ====
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration8_es6.ts (1 errors) ====
var v = { [yield]: foo }
~
!!! error TS1136: Property assignment expected.
~
!!! error TS1005: ',' expected.
~
!!! error TS1128: Declaration or statement expected.
~~~~~
!!! error TS2304: Cannot find name 'yield'.
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.

View File

@@ -1,15 +1,9 @@
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(2,13): error TS1136: Property assignment expected.
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(2,20): error TS1005: ',' expected.
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(3,1): error TS1128: Declaration or statement expected.
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(1,10): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts (3 errors) ====
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts (1 errors) ====
function * foo() {
~
!!! error TS9001: 'generators' are not currently supported.
var v = { [yield]: foo }
~
!!! error TS1136: Property assignment expected.
~
!!! error TS1005: ',' expected.
}
~
!!! error TS1128: Declaration or statement expected.
}

View File

@@ -0,0 +1,7 @@
tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts(1,18): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts (1 errors) ====
var v = function * () { }
~
!!! error TS9001: 'generators' are not currently supported.

View File

@@ -1,6 +0,0 @@
//// [FunctionExpression1_es6.ts]
var v = function * () { }
//// [FunctionExpression1_es6.js]
var v = function () {
};

View File

@@ -1,5 +0,0 @@
=== tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts ===
var v = function * () { }
>v : () => void
>function * () { } : () => void

View File

@@ -0,0 +1,7 @@
tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts(1,18): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts (1 errors) ====
var v = function * foo() { }
~
!!! error TS9001: 'generators' are not currently supported.

View File

@@ -1,6 +0,0 @@
//// [FunctionExpression2_es6.ts]
var v = function * foo() { }
//// [FunctionExpression2_es6.js]
var v = function foo() {
};

View File

@@ -1,6 +0,0 @@
=== tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts ===
var v = function * foo() { }
>v : () => void
>function * foo() { } : () => void
>foo : () => void

View File

@@ -0,0 +1,7 @@
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts(1,11): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts (1 errors) ====
var v = { *foo() { } }
~
!!! error TS9001: 'generators' are not currently supported.

View File

@@ -1,6 +0,0 @@
//// [FunctionPropertyAssignments1_es6.ts]
var v = { *foo() { } }
//// [FunctionPropertyAssignments1_es6.js]
var v = { foo: function () {
} };

View File

@@ -1,7 +0,0 @@
=== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts ===
var v = { *foo() { } }
>v : { foo: () => void; }
>{ *foo() { } } : { foo: () => void; }
>foo : () => void
>*foo() { } : () => void

View File

@@ -1,16 +1,10 @@
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,12): error TS1003: Identifier expected.
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,22): error TS1005: ',' expected.
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,26): error TS1128: Declaration or statement expected.
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,13): error TS2304: Cannot find name 'foo'.
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,11): error TS9001: 'generators' are not currently supported.
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,12): error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.
==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts (4 errors) ====
==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts (2 errors) ====
var v = { *[foo()]() { } }
~
!!! error TS1003: Identifier expected.
~
!!! error TS1005: ',' expected.
~
!!! error TS1128: Declaration or statement expected.
~~~
!!! error TS2304: Cannot find name 'foo'.
~
!!! error TS9001: 'generators' are not currently supported.
~~~~~~~
!!! error TS1167: Computed property names are only available when targeting ECMAScript 6 and higher.

View File

@@ -0,0 +1,9 @@
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts(2,4): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts (1 errors) ====
class C {
*foo() { }
~
!!! error TS9001: 'generators' are not currently supported.
}

View File

@@ -1,13 +0,0 @@
//// [MemberFunctionDeclaration1_es6.ts]
class C {
*foo() { }
}
//// [MemberFunctionDeclaration1_es6.js]
var C = (function () {
function C() {
}
C.prototype.foo = function () {
};
return C;
})();

View File

@@ -1,7 +0,0 @@
=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts ===
class C {
>C : C
*foo() { }
>foo : () => void
}

View File

@@ -0,0 +1,9 @@
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts(2,11): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts (1 errors) ====
class C {
public * foo() { }
~
!!! error TS9001: 'generators' are not currently supported.
}

View File

@@ -1,13 +0,0 @@
//// [MemberFunctionDeclaration2_es6.ts]
class C {
public * foo() { }
}
//// [MemberFunctionDeclaration2_es6.js]
var C = (function () {
function C() {
}
C.prototype.foo = function () {
};
return C;
})();

View File

@@ -1,7 +0,0 @@
=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts ===
class C {
>C : C
public * foo() { }
>foo : () => void
}

View File

@@ -1,18 +1,9 @@
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,5): error TS1003: Identifier expected.
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,10): error TS1005: ';' expected.
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,13): error TS1005: '=>' expected.
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(3,1): error TS1128: Declaration or statement expected.
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,4): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts (4 errors) ====
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts (1 errors) ====
class C {
*[foo]() { }
~
!!! error TS1003: Identifier expected.
~
!!! error TS1005: ';' expected.
~
!!! error TS1005: '=>' expected.
}
~
!!! error TS1128: Declaration or statement expected.
~
!!! error TS9001: 'generators' are not currently supported.
}

View File

@@ -0,0 +1,9 @@
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts(2,4): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts (1 errors) ====
class C {
*foo<T>() { }
~
!!! error TS9001: 'generators' are not currently supported.
}

View File

@@ -1,13 +0,0 @@
//// [MemberFunctionDeclaration7_es6.ts]
class C {
*foo<T>() { }
}
//// [MemberFunctionDeclaration7_es6.js]
var C = (function () {
function C() {
}
C.prototype.foo = function () {
};
return C;
})();

View File

@@ -1,8 +0,0 @@
=== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts ===
class C {
>C : C
*foo<T>() { }
>foo : <T>() => void
>T : T
}

View File

@@ -0,0 +1,11 @@
tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts(1,11): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts (1 errors) ====
var v = { * foo() {
~
!!! error TS9001: 'generators' are not currently supported.
yield(foo);
}
}

View File

@@ -1,11 +0,0 @@
//// [YieldExpression10_es6.ts]
var v = { * foo() {
yield(foo);
}
}
//// [YieldExpression10_es6.js]
var v = { foo: function () {
;
} };

View File

@@ -1,11 +0,0 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts ===
var v = { * foo() {
>v : { foo: () => void; }
>{ * foo() { yield(foo); }} : { foo: () => void; }
>foo : () => void
>* foo() { yield(foo); } : () => void
yield(foo);
}
}

View File

@@ -0,0 +1,11 @@
tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(2,3): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts (1 errors) ====
class C {
*foo() {
~
!!! error TS9001: 'generators' are not currently supported.
yield(foo);
}
}

View File

@@ -1,16 +0,0 @@
//// [YieldExpression11_es6.ts]
class C {
*foo() {
yield(foo);
}
}
//// [YieldExpression11_es6.js]
var C = (function () {
function C() {
}
C.prototype.foo = function () {
;
};
return C;
})();

View File

@@ -1,10 +0,0 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts ===
class C {
>C : C
*foo() {
>foo : () => void
yield(foo);
}
}

View File

@@ -0,0 +1,7 @@
tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts(1,9): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts (1 errors) ====
function* foo() { yield }
~
!!! error TS9001: 'generators' are not currently supported.

View File

@@ -1,7 +0,0 @@
//// [YieldExpression13_es6.ts]
function* foo() { yield }
//// [YieldExpression13_es6.js]
function foo() {
;
}

View File

@@ -1,4 +0,0 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts ===
function* foo() { yield }
>foo : () => void

View File

@@ -1,11 +1,11 @@
tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(3,5): error TS1163: 'yield' expression must be contained_within a generator declaration.
tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(1,9): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts (1 errors) ====
function* foo() {
~
!!! error TS9001: 'generators' are not currently supported.
function bar() {
yield foo;
~~~~~
!!! error TS1163: 'yield' expression must be contained_within a generator declaration.
}
}

View File

@@ -0,0 +1,13 @@
tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(1,9): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts (1 errors) ====
function*foo() {
~
!!! error TS9001: 'generators' are not currently supported.
function bar() {
function* quux() {
yield(foo);
}
}
}

View File

@@ -1,17 +0,0 @@
//// [YieldExpression19_es6.ts]
function*foo() {
function bar() {
function* quux() {
yield(foo);
}
}
}
//// [YieldExpression19_es6.js]
function foo() {
function bar() {
function quux() {
;
}
}
}

View File

@@ -1,14 +0,0 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts ===
function*foo() {
>foo : () => void
function bar() {
>bar : () => void
function* quux() {
>quux : () => void
yield(foo);
}
}
}

View File

@@ -0,0 +1,10 @@
tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts(1,9): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts (1 errors) ====
function* foo() {
~
!!! error TS9001: 'generators' are not currently supported.
yield
yield
}

View File

@@ -1,11 +0,0 @@
//// [YieldExpression3_es6.ts]
function* foo() {
yield
yield
}
//// [YieldExpression3_es6.js]
function foo() {
;
;
}

View File

@@ -1,7 +0,0 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts ===
function* foo() {
>foo : () => void
yield
yield
}

View File

@@ -0,0 +1,10 @@
tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts(1,9): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts (1 errors) ====
function* foo() {
~
!!! error TS9001: 'generators' are not currently supported.
yield;
yield;
}

View File

@@ -1,11 +0,0 @@
//// [YieldExpression4_es6.ts]
function* foo() {
yield;
yield;
}
//// [YieldExpression4_es6.js]
function foo() {
;
;
}

View File

@@ -1,7 +0,0 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts ===
function* foo() {
>foo : () => void
yield;
yield;
}

View File

@@ -0,0 +1,9 @@
tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts(1,9): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts (1 errors) ====
function* foo() {
~
!!! error TS9001: 'generators' are not currently supported.
yield*foo
}

View File

@@ -1,9 +0,0 @@
//// [YieldExpression6_es6.ts]
function* foo() {
yield*foo
}
//// [YieldExpression6_es6.js]
function foo() {
;
}

View File

@@ -1,6 +0,0 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts ===
function* foo() {
>foo : () => void
yield*foo
}

View File

@@ -0,0 +1,9 @@
tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts(1,9): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts (1 errors) ====
function* foo() {
~
!!! error TS9001: 'generators' are not currently supported.
yield foo
}

View File

@@ -1,9 +0,0 @@
//// [YieldExpression7_es6.ts]
function* foo() {
yield foo
}
//// [YieldExpression7_es6.js]
function foo() {
;
}

View File

@@ -1,6 +0,0 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts ===
function* foo() {
>foo : () => void
yield foo
}

View File

@@ -1,10 +1,13 @@
tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(2,9): error TS9001: 'generators' are not currently supported.
tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(1,1): error TS2304: Cannot find name 'yield'.
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts (1 errors) ====
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts (2 errors) ====
yield(foo);
~~~~~
!!! error TS2304: Cannot find name 'yield'.
function* foo() {
~
!!! error TS9001: 'generators' are not currently supported.
yield(foo);
}

View File

@@ -1,11 +0,0 @@
//// [YieldExpression8_es6.ts]
yield(foo);
function* foo() {
yield(foo);
}
//// [YieldExpression8_es6.js]
yield(foo);
function foo() {
;
}

View File

@@ -0,0 +1,9 @@
tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts(1,17): error TS9001: 'generators' are not currently supported.
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts (1 errors) ====
var v = function*() {
~
!!! error TS9001: 'generators' are not currently supported.
yield(foo);
}

View File

@@ -1,9 +0,0 @@
//// [YieldExpression9_es6.ts]
var v = function*() {
yield(foo);
}
//// [YieldExpression9_es6.js]
var v = function () {
;
};

View File

@@ -1,7 +0,0 @@
=== tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts ===
var v = function*() {
>v : () => void
>function*() { yield(foo);} : () => void
yield(foo);
}

View File

@@ -0,0 +1,14 @@
//// [computedPropertyNames1.ts]
var v = {
get [0 + 1]() { return 0 },
set [0 + 1](v: string) { } //No error
}
//// [computedPropertyNames1.js]
var v = {
get [0 + 1]() {
return 0;
},
set [0 + 1](v) {
} //No error
};

View File

@@ -0,0 +1,12 @@
=== tests/cases/conformance/es6/computedProperties/computedPropertyNames1.ts ===
var v = {
>v : {}
>{ get [0 + 1]() { return 0 }, set [0 + 1](v: string) { } //No error} : {}
get [0 + 1]() { return 0 },
>0 + 1 : number
set [0 + 1](v: string) { } //No error
>0 + 1 : number
>v : string
}

View File

@@ -0,0 +1,19 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(6,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts(8,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames2.ts (2 errors) ====
var methodName = "method";
var accessorName = "accessor";
class C {
[methodName]() { }
static [methodName]() { }
get [accessorName]() { }
~~~~~~~~~~~~~~
!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
set [accessorName](v) { }
static get [accessorName]() { }
~~~~~~~~~~~~~~
!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
static set [accessorName](v) { }
}

View File

@@ -0,0 +1,48 @@
//// [computedPropertyNames2.ts]
var methodName = "method";
var accessorName = "accessor";
class C {
[methodName]() { }
static [methodName]() { }
get [accessorName]() { }
set [accessorName](v) { }
static get [accessorName]() { }
static set [accessorName](v) { }
}
//// [computedPropertyNames2.js]
var methodName = "method";
var accessorName = "accessor";
var C = (function () {
function C() {
}
C.prototype[methodName] = function () {
};
C[methodName] = function () {
};
Object.defineProperty(C.prototype, accessorName, {
get: function () {
},
enumerable: true,
configurable: true
});
Object.defineProperty(C.prototype, accessorName, {
set: function (v) {
},
enumerable: true,
configurable: true
});
Object.defineProperty(C, accessorName, {
get: function () {
},
enumerable: true,
configurable: true
});
Object.defineProperty(C, accessorName, {
set: function (v) {
},
enumerable: true,
configurable: true
});
return C;
})();

View File

@@ -0,0 +1,18 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(5,9): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts(7,16): error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNames3.ts (2 errors) ====
var id;
class C {
[0 + 1]() { }
static [() => { }]() { }
get [delete id]() { }
~~~~~~~~~~~
!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
set [[0, 1]](v) { }
static get [<String>""]() { }
~~~~~~~~~~~~
!!! error TS2378: A 'get' accessor must return a value or consist of a single 'throw' statement.
static set [id.toString()](v) { }
}

View File

@@ -0,0 +1,47 @@
//// [computedPropertyNames3.ts]
var id;
class C {
[0 + 1]() { }
static [() => { }]() { }
get [delete id]() { }
set [[0, 1]](v) { }
static get [<String>""]() { }
static set [id.toString()](v) { }
}
//// [computedPropertyNames3.js]
var id;
var C = (function () {
function C() {
}
C.prototype[0 + 1] = function () {
};
C[function () {
}] = function () {
};
Object.defineProperty(C.prototype, delete id, {
get: function () {
},
enumerable: true,
configurable: true
});
Object.defineProperty(C.prototype, [0, 1], {
set: function (v) {
},
enumerable: true,
configurable: true
});
Object.defineProperty(C, "", {
get: function () {
},
enumerable: true,
configurable: true
});
Object.defineProperty(C, id.toString(), {
set: function (v) {
},
enumerable: true,
configurable: true
});
return C;
})();

View File

@@ -0,0 +1,16 @@
tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads.ts(4,5): error TS1168: Computed property names are not allowed in method overloads.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads.ts(5,5): error TS1168: Computed property names are not allowed in method overloads.
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesOnOverloads.ts (2 errors) ====
var methodName = "method";
var accessorName = "accessor";
class C {
[methodName](v: string);
~~~~~~~~~~~~
!!! error TS1168: Computed property names are not allowed in method overloads.
[methodName]();
~~~~~~~~~~~~
!!! error TS1168: Computed property names are not allowed in method overloads.
[methodName](v?: string) { }
}

View File

@@ -1,70 +0,0 @@
tests/cases/compiler/defaultArgsForwardReferencing.ts(6,20): error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it.
tests/cases/compiler/defaultArgsForwardReferencing.ts(11,21): error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it.
tests/cases/compiler/defaultArgsForwardReferencing.ts(11,28): error TS2373: Initializer of parameter 'b' cannot reference identifier 'c' declared after it.
tests/cases/compiler/defaultArgsForwardReferencing.ts(17,21): error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it.
tests/cases/compiler/defaultArgsForwardReferencing.ts(23,25): error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it.
tests/cases/compiler/defaultArgsForwardReferencing.ts(32,21): error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it.
tests/cases/compiler/defaultArgsForwardReferencing.ts(33,16): error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it.
tests/cases/compiler/defaultArgsForwardReferencing.ts(37,14): error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it.
tests/cases/compiler/defaultArgsForwardReferencing.ts(37,21): error TS2373: Initializer of parameter 'b' cannot reference identifier 'c' declared after it.
tests/cases/compiler/defaultArgsForwardReferencing.ts(37,28): error TS2373: Initializer of parameter 'c' cannot reference identifier 'd' declared after it.
==== tests/cases/compiler/defaultArgsForwardReferencing.ts (10 errors) ====
function left(a, b = a, c = b) {
a;
b;
}
function right(a = b, b = a) {
~
!!! error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it.
a;
b;
}
function right2(a = b, b = c, c = a) {
~
!!! error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it.
~
!!! error TS2373: Initializer of parameter 'b' cannot reference identifier 'c' declared after it.
a;
b;
c;
}
function inside(a = b) {
~
!!! error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it.
var b;
}
function outside() {
var b;
function inside(a = b) { // Still an error because b is declared inside the function
~
!!! error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it.
var b;
}
}
function defaultArgFunction(a = function () { return b; }, b = 1) { }
function defaultArgArrow(a = () => () => b, b = 3) { }
class C {
constructor(a = b, b = 1) { }
~
!!! error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it.
method(a = b, b = 1) { }
~
!!! error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it.
}
// Function expressions
var x = (a = b, b = c, c = d) => { var d; };
~
!!! error TS2373: Initializer of parameter 'a' cannot reference identifier 'b' declared after it.
~
!!! error TS2373: Initializer of parameter 'b' cannot reference identifier 'c' declared after it.
~
!!! error TS2373: Initializer of parameter 'c' cannot reference identifier 'd' declared after it.

View File

@@ -0,0 +1,102 @@
tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(24,38): error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(53,38): error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(69,38): error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts(85,38): error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }' is not assignable to parameter of type '(x: number) => Promise<boolean>'.
==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallToOverloadedMethodWithOverloadedArguments.ts (4 errors) ====
module m1 {
interface Promise<T> {
then<U>(cb: (x: T) => Promise<U>): Promise<U>;
}
declare function testFunction(n: number): Promise<number>;
var numPromise: Promise<number>;
var newPromise = numPromise.then(testFunction);
}
//////////////////////////////////////
module m2 {
interface Promise<T> {
then<U>(cb: (x: T) => Promise<U>): Promise<U>;
}
declare function testFunction(n: number): Promise<number>;
declare function testFunction(s: string): Promise<string>;
var numPromise: Promise<number>;
var newPromise = numPromise.then(testFunction);
~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
}
//////////////////////////////////////
module m3 {
interface Promise<T> {
then<U>(cb: (x: T) => Promise<U>): Promise<U>;
then<U>(cb: (x: T) => Promise<U>, error?: (error: any) => Promise<U>): Promise<U>;
}
declare function testFunction(n: number): Promise<number>;
var numPromise: Promise<number>;
var newPromise = numPromise.then(testFunction);
}
//////////////////////////////////////
module m4 {
interface Promise<T> {
then<U>(cb: (x: T) => Promise<U>): Promise<U>;
then<U>(cb: (x: T) => Promise<U>, error?: (error: any) => Promise<U>): Promise<U>;
}
declare function testFunction(n: number): Promise<number>;
declare function testFunction(s: string): Promise<string>;
var numPromise: Promise<number>;
var newPromise = numPromise.then(testFunction);
~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
}
//////////////////////////////////////
module m5 {
interface Promise<T> {
then<U>(cb: (x: T) => Promise<U>): Promise<U>;
then<U>(cb: (x: T) => Promise<U>, error?: (error: any) => Promise<U>): Promise<U>;
then<U>(cb: (x: T) => Promise<U>, error?: (error: any) => U, progress?: (preservation: any) => void): Promise<U>;
}
declare function testFunction(n: number): Promise<number>;
declare function testFunction(s: string): Promise<string>;
var numPromise: Promise<number>;
var newPromise = numPromise.then(testFunction);
~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; }' is not assignable to parameter of type '(x: number) => Promise<string>'.
}
//////////////////////////////////////
module m6 {
interface Promise<T> {
then<U>(cb: (x: T) => Promise<U>): Promise<U>;
then<U>(cb: (x: T) => Promise<U>, error?: (error: any) => Promise<U>): Promise<U>;
}
declare function testFunction(n: number): Promise<number>;
declare function testFunction(s: string): Promise<string>;
declare function testFunction(b: boolean): Promise<boolean>;
var numPromise: Promise<number>;
var newPromise = numPromise.then(testFunction);
~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ (n: number): Promise<number>; (s: string): Promise<string>; (b: boolean): Promise<boolean>; }' is not assignable to parameter of type '(x: number) => Promise<boolean>'.
}

View File

@@ -0,0 +1,125 @@
//// [genericCallToOverloadedMethodWithOverloadedArguments.ts]
module m1 {
interface Promise<T> {
then<U>(cb: (x: T) => Promise<U>): Promise<U>;
}
declare function testFunction(n: number): Promise<number>;
var numPromise: Promise<number>;
var newPromise = numPromise.then(testFunction);
}
//////////////////////////////////////
module m2 {
interface Promise<T> {
then<U>(cb: (x: T) => Promise<U>): Promise<U>;
}
declare function testFunction(n: number): Promise<number>;
declare function testFunction(s: string): Promise<string>;
var numPromise: Promise<number>;
var newPromise = numPromise.then(testFunction);
}
//////////////////////////////////////
module m3 {
interface Promise<T> {
then<U>(cb: (x: T) => Promise<U>): Promise<U>;
then<U>(cb: (x: T) => Promise<U>, error?: (error: any) => Promise<U>): Promise<U>;
}
declare function testFunction(n: number): Promise<number>;
var numPromise: Promise<number>;
var newPromise = numPromise.then(testFunction);
}
//////////////////////////////////////
module m4 {
interface Promise<T> {
then<U>(cb: (x: T) => Promise<U>): Promise<U>;
then<U>(cb: (x: T) => Promise<U>, error?: (error: any) => Promise<U>): Promise<U>;
}
declare function testFunction(n: number): Promise<number>;
declare function testFunction(s: string): Promise<string>;
var numPromise: Promise<number>;
var newPromise = numPromise.then(testFunction);
}
//////////////////////////////////////
module m5 {
interface Promise<T> {
then<U>(cb: (x: T) => Promise<U>): Promise<U>;
then<U>(cb: (x: T) => Promise<U>, error?: (error: any) => Promise<U>): Promise<U>;
then<U>(cb: (x: T) => Promise<U>, error?: (error: any) => U, progress?: (preservation: any) => void): Promise<U>;
}
declare function testFunction(n: number): Promise<number>;
declare function testFunction(s: string): Promise<string>;
var numPromise: Promise<number>;
var newPromise = numPromise.then(testFunction);
}
//////////////////////////////////////
module m6 {
interface Promise<T> {
then<U>(cb: (x: T) => Promise<U>): Promise<U>;
then<U>(cb: (x: T) => Promise<U>, error?: (error: any) => Promise<U>): Promise<U>;
}
declare function testFunction(n: number): Promise<number>;
declare function testFunction(s: string): Promise<string>;
declare function testFunction(b: boolean): Promise<boolean>;
var numPromise: Promise<number>;
var newPromise = numPromise.then(testFunction);
}
//// [genericCallToOverloadedMethodWithOverloadedArguments.js]
var m1;
(function (m1) {
var numPromise;
var newPromise = numPromise.then(testFunction);
})(m1 || (m1 = {}));
//////////////////////////////////////
var m2;
(function (m2) {
var numPromise;
var newPromise = numPromise.then(testFunction);
})(m2 || (m2 = {}));
//////////////////////////////////////
var m3;
(function (m3) {
var numPromise;
var newPromise = numPromise.then(testFunction);
})(m3 || (m3 = {}));
//////////////////////////////////////
var m4;
(function (m4) {
var numPromise;
var newPromise = numPromise.then(testFunction);
})(m4 || (m4 = {}));
//////////////////////////////////////
var m5;
(function (m5) {
var numPromise;
var newPromise = numPromise.then(testFunction);
})(m5 || (m5 = {}));
//////////////////////////////////////
var m6;
(function (m6) {
var numPromise;
var newPromise = numPromise.then(testFunction);
})(m6 || (m6 = {}));

View File

@@ -4,7 +4,7 @@ tests/cases/compiler/giant.ts(28,17): error TS1056: Accessors are only available
tests/cases/compiler/giant.ts(30,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(34,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(36,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(61,6): error TS1022: An index signature parameter must have a type annotation.
tests/cases/compiler/giant.ts(61,5): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/giant.ts(62,5): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(63,6): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(88,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -13,7 +13,7 @@ tests/cases/compiler/giant.ts(92,21): error TS1056: Accessors are only available
tests/cases/compiler/giant.ts(94,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(98,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(100,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(125,10): error TS1022: An index signature parameter must have a type annotation.
tests/cases/compiler/giant.ts(125,9): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/giant.ts(126,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(127,10): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(154,39): error TS1037: A function implementation cannot be declared in an ambient context.
@@ -23,7 +23,7 @@ tests/cases/compiler/giant.ts(171,21): error TS1056: Accessors are only availabl
tests/cases/compiler/giant.ts(173,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(177,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(179,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(204,10): error TS1022: An index signature parameter must have a type annotation.
tests/cases/compiler/giant.ts(204,9): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/giant.ts(205,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(206,10): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(233,39): error TS1037: A function implementation cannot be declared in an ambient context.
@@ -54,7 +54,7 @@ tests/cases/compiler/giant.ts(286,17): error TS1056: Accessors are only availabl
tests/cases/compiler/giant.ts(288,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(292,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(294,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(319,6): error TS1022: An index signature parameter must have a type annotation.
tests/cases/compiler/giant.ts(319,5): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/giant.ts(320,5): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(321,6): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(346,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -63,7 +63,7 @@ tests/cases/compiler/giant.ts(350,21): error TS1056: Accessors are only availabl
tests/cases/compiler/giant.ts(352,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(356,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(358,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(383,10): error TS1022: An index signature parameter must have a type annotation.
tests/cases/compiler/giant.ts(383,9): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/giant.ts(384,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(385,10): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(412,39): error TS1037: A function implementation cannot be declared in an ambient context.
@@ -73,7 +73,7 @@ tests/cases/compiler/giant.ts(429,21): error TS1056: Accessors are only availabl
tests/cases/compiler/giant.ts(431,21): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(435,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(437,20): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/giant.ts(462,10): error TS1022: An index signature parameter must have a type annotation.
tests/cases/compiler/giant.ts(462,9): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/giant.ts(463,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(464,10): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(491,39): error TS1037: A function implementation cannot be declared in an ambient context.
@@ -120,7 +120,7 @@ tests/cases/compiler/giant.ts(556,21): error TS1036: Statements are not allowed
tests/cases/compiler/giant.ts(558,24): error TS1111: A constructor implementation cannot be declared in an ambient context.
tests/cases/compiler/giant.ts(561,21): error TS1037: A function implementation cannot be declared in an ambient context.
tests/cases/compiler/giant.ts(563,21): error TS1037: A function implementation cannot be declared in an ambient context.
tests/cases/compiler/giant.ts(587,10): error TS1022: An index signature parameter must have a type annotation.
tests/cases/compiler/giant.ts(587,9): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/giant.ts(588,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(589,10): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(606,22): error TS1037: A function implementation cannot be declared in an ambient context.
@@ -137,7 +137,7 @@ tests/cases/compiler/giant.ts(621,29): error TS1036: Statements are not allowed
tests/cases/compiler/giant.ts(623,24): error TS1111: A constructor implementation cannot be declared in an ambient context.
tests/cases/compiler/giant.ts(626,21): error TS1037: A function implementation cannot be declared in an ambient context.
tests/cases/compiler/giant.ts(628,21): error TS1037: A function implementation cannot be declared in an ambient context.
tests/cases/compiler/giant.ts(653,10): error TS1022: An index signature parameter must have a type annotation.
tests/cases/compiler/giant.ts(653,9): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/giant.ts(654,9): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/giant.ts(655,10): error TS1096: An index signature must have exactly one parameter.
tests/cases/compiler/giant.ts(672,22): error TS1037: A function implementation cannot be declared in an ambient context.
@@ -360,8 +360,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all
//Index Signature
[p];
~
!!! error TS1022: An index signature parameter must have a type annotation.
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
[p1: string];
~~~~~~~~~~~~~
!!! error TS1021: An index signature must have a type annotation.
@@ -468,8 +468,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all
//Index Signature
[p];
~
!!! error TS1022: An index signature parameter must have a type annotation.
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
[p1: string];
~~~~~~~~~~~~~
!!! error TS1021: An index signature must have a type annotation.
@@ -593,8 +593,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all
//Index Signature
[p];
~
!!! error TS1022: An index signature parameter must have a type annotation.
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
[p1: string];
~~~~~~~~~~~~~
!!! error TS1021: An index signature must have a type annotation.
@@ -820,8 +820,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all
//Index Signature
[p];
~
!!! error TS1022: An index signature parameter must have a type annotation.
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
[p1: string];
~~~~~~~~~~~~~
!!! error TS1021: An index signature must have a type annotation.
@@ -928,8 +928,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all
//Index Signature
[p];
~
!!! error TS1022: An index signature parameter must have a type annotation.
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
[p1: string];
~~~~~~~~~~~~~
!!! error TS1021: An index signature must have a type annotation.
@@ -1053,8 +1053,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all
//Index Signature
[p];
~
!!! error TS1022: An index signature parameter must have a type annotation.
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
[p1: string];
~~~~~~~~~~~~~
!!! error TS1021: An index signature must have a type annotation.
@@ -1322,8 +1322,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all
//Index Signature
[p];
~
!!! error TS1022: An index signature parameter must have a type annotation.
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
[p1: string];
~~~~~~~~~~~~~
!!! error TS1021: An index signature must have a type annotation.
@@ -1424,8 +1424,8 @@ tests/cases/compiler/giant.ts(668,9): error TS2386: Overload signatures must all
//Index Signature
[p];
~
!!! error TS1022: An index signature parameter must have a type annotation.
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
[p1: string];
~~~~~~~~~~~~~
!!! error TS1021: An index signature must have a type annotation.

View File

@@ -1,14 +1,14 @@
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(2,6): error TS1022: An index signature parameter must have a type annotation.
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(2,5): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(3,5): error TS1021: An index signature must have a type annotation.
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(7,6): error TS1022: An index signature parameter must have a type annotation.
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(7,5): error TS1166: Computed property names are not allowed in class property declarations.
tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(12,5): error TS1021: An index signature must have a type annotation.
==== tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts (4 errors) ====
interface I {
[x]: string;
~
!!! error TS1022: An index signature parameter must have a type annotation.
~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
[x: string];
~~~~~~~~~~~~
!!! error TS1021: An index signature must have a type annotation.
@@ -16,8 +16,8 @@ tests/cases/compiler/indexSignatureMustHaveTypeAnnotation.ts(12,5): error TS1021
class C {
[x]: string
~
!!! error TS1022: An index signature parameter must have a type annotation.
~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
}

View File

@@ -1,22 +1,16 @@
tests/cases/compiler/indexSignatureWithInitializer.ts(2,6): error TS1020: An index signature parameter cannot have an initializer.
tests/cases/compiler/indexSignatureWithInitializer.ts(6,6): error TS1020: An index signature parameter cannot have an initializer.
tests/cases/compiler/indexSignatureWithInitializer.ts(2,6): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
tests/cases/compiler/indexSignatureWithInitializer.ts(6,6): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
tests/cases/compiler/indexSignatureWithInitializer.ts(2,5): error TS1169: Computed property names are not allowed in interfaces.
tests/cases/compiler/indexSignatureWithInitializer.ts(6,5): error TS1166: Computed property names are not allowed in class property declarations.
==== tests/cases/compiler/indexSignatureWithInitializer.ts (4 errors) ====
==== tests/cases/compiler/indexSignatureWithInitializer.ts (2 errors) ====
interface I {
[x = '']: string;
~
!!! error TS1020: An index signature parameter cannot have an initializer.
~~~~~~
!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
~~~~~~~~
!!! error TS1169: Computed property names are not allowed in interfaces.
}
class C {
[x = 0]: string
~
!!! error TS1020: An index signature parameter cannot have an initializer.
~~~~~
!!! error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
~~~~~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
}

View File

@@ -1,9 +1,9 @@
tests/cases/compiler/indexWithoutParamType2.ts(2,6): error TS1022: An index signature parameter must have a type annotation.
tests/cases/compiler/indexWithoutParamType2.ts(2,5): error TS1166: Computed property names are not allowed in class property declarations.
==== tests/cases/compiler/indexWithoutParamType2.ts (1 errors) ====
class C {
[x]: string
~
!!! error TS1022: An index signature parameter must have a type annotation.
~~~
!!! error TS1166: Computed property names are not allowed in class property declarations.
}

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