mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into unionTypes
This commit is contained in:
+4
-1
@@ -1,12 +1,15 @@
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts(5,12): error TS2300: Duplicate identifier 'fn'.
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts(10,21): error TS2300: Duplicate identifier 'fn'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts (1 errors) ====
|
||||
==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts (2 errors) ====
|
||||
class clodule<T> {
|
||||
id: string;
|
||||
value: T;
|
||||
|
||||
static fn<U>(id: U) { }
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'fn'.
|
||||
}
|
||||
|
||||
module clodule {
|
||||
|
||||
+4
-1
@@ -1,12 +1,15 @@
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts(5,12): error TS2300: Duplicate identifier 'fn'.
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts(10,21): error TS2300: Duplicate identifier 'fn'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts (1 errors) ====
|
||||
==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts (2 errors) ====
|
||||
class clodule<T> {
|
||||
id: string;
|
||||
value: T;
|
||||
|
||||
static fn(id: string) { }
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'fn'.
|
||||
}
|
||||
|
||||
module clodule {
|
||||
|
||||
+7
-1
@@ -1,12 +1,16 @@
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(4,12): error TS2300: Duplicate identifier 'Origin'.
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(8,21): error TS2300: Duplicate identifier 'Origin'.
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(16,16): error TS2300: Duplicate identifier 'Origin'.
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts(20,25): error TS2300: Duplicate identifier 'Origin'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts (2 errors) ====
|
||||
==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts (4 errors) ====
|
||||
class Point {
|
||||
constructor(public x: number, public y: number) { }
|
||||
|
||||
static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246
|
||||
~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'Origin'.
|
||||
}
|
||||
|
||||
module Point {
|
||||
@@ -21,6 +25,8 @@ tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMer
|
||||
constructor(public x: number, public y: number) { }
|
||||
|
||||
static Origin(): Point { return { x: 0, y: 0 }; } // unexpected error here bug 840246
|
||||
~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'Origin'.
|
||||
}
|
||||
|
||||
export module Point {
|
||||
|
||||
+7
-1
@@ -1,12 +1,16 @@
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts(4,12): error TS2300: Duplicate identifier 'Origin'.
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts(8,16): error TS2300: Duplicate identifier 'Origin'.
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts(16,16): error TS2300: Duplicate identifier 'Origin'.
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts(20,20): error TS2300: Duplicate identifier 'Origin'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts (2 errors) ====
|
||||
==== tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts (4 errors) ====
|
||||
class Point {
|
||||
constructor(public x: number, public y: number) { }
|
||||
|
||||
static Origin: Point = { x: 0, y: 0 };
|
||||
~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'Origin'.
|
||||
}
|
||||
|
||||
module Point {
|
||||
@@ -21,6 +25,8 @@ tests/cases/conformance/internalModules/DeclarationMerging/ClassAndModuleThatMer
|
||||
constructor(public x: number, public y: number) { }
|
||||
|
||||
static Origin: Point = { x: 0, y: 0 };
|
||||
~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'Origin'.
|
||||
}
|
||||
|
||||
export module Point {
|
||||
|
||||
+7
-1
@@ -1,10 +1,14 @@
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(2,18): error TS2300: Duplicate identifier 'Point'.
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(10,18): error TS2300: Duplicate identifier 'Point'.
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(17,18): error TS2300: Duplicate identifier 'Line'.
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts(26,26): error TS2300: Duplicate identifier 'Line'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts (2 errors) ====
|
||||
==== tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts (4 errors) ====
|
||||
module A {
|
||||
export class Point {
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'Point'.
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
@@ -22,6 +26,8 @@ tests/cases/conformance/internalModules/DeclarationMerging/TwoInternalModulesTha
|
||||
|
||||
module X.Y.Z {
|
||||
export class Line {
|
||||
~~~~
|
||||
!!! error TS2300: Duplicate identifier 'Line'.
|
||||
length: number;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
tests/cases/compiler/ambientClassOverloadForFunction.ts(1,15): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/compiler/ambientClassOverloadForFunction.ts(2,10): error TS2300: Duplicate identifier 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/ambientClassOverloadForFunction.ts (1 errors) ====
|
||||
==== tests/cases/compiler/ambientClassOverloadForFunction.ts (2 errors) ====
|
||||
declare class foo{};
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
function foo() { return null; }
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
tests/cases/compiler/anyDeclare.ts(3,9): error TS2300: Duplicate identifier 'myFn'.
|
||||
tests/cases/compiler/anyDeclare.ts(4,14): error TS2300: Duplicate identifier 'myFn'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/anyDeclare.ts (1 errors) ====
|
||||
==== tests/cases/compiler/anyDeclare.ts (2 errors) ====
|
||||
declare var x: any;
|
||||
module myMod {
|
||||
var myFn;
|
||||
~~~~
|
||||
!!! error TS2300: Duplicate identifier 'myFn'.
|
||||
function myFn() { }
|
||||
~~~~
|
||||
!!! error TS2300: Duplicate identifier 'myFn'.
|
||||
|
||||
@@ -395,8 +395,7 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(417,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(418,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(420,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(421,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(421,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(421,12): error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(422,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(423,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(423,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -451,8 +450,7 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(474,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(475,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(477,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(478,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(478,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(478,12): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(479,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(480,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(480,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -507,8 +505,7 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(531,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(532,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(534,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(535,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(535,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(535,13): error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(536,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(537,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(537,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -560,7 +557,7 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts(581,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts (560 errors) ====
|
||||
==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithInvalidOperands.ts (557 errors) ====
|
||||
// these operators require their operands to be of type Any, the Number primitive type, or
|
||||
// an enum type
|
||||
enum E { a, b, c }
|
||||
@@ -1776,10 +1773,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
var r8b2 = b & b;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~
|
||||
!!! error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
var r8b3 = b & c;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -1945,10 +1940,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
var r9b2 = b ^ b;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~
|
||||
!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
var r9b3 = b ^ c;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -2114,10 +2107,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
var r10b2 = b | b;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~
|
||||
!!! error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
var r10b3 = b | c;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
+37
-73
@@ -166,81 +166,69 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(124,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(125,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(125,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(128,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(128,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(128,12): error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(129,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(129,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(130,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(130,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(132,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(132,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(132,12): error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(133,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(133,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(134,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(134,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(136,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(136,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(136,12): error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(137,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(137,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(138,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(138,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(140,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(140,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(140,12): error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(141,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(141,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(142,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(142,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(145,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(145,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(145,12): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(146,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(146,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(147,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(147,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(149,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(149,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(149,12): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(150,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(150,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(151,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(151,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(153,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(153,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(153,12): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(154,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(154,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(155,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(155,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(157,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(157,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(157,12): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(158,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(158,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(159,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(159,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(162,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(162,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(162,13): error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(163,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(163,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(164,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(164,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(166,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(166,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(166,13): error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(167,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(167,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(168,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(168,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(170,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(170,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(170,13): error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(171,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(171,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(172,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(172,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(174,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(174,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(174,13): error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(175,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(175,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(176,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts(176,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts (240 errors) ====
|
||||
==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithNullValueAndInvalidOperands.ts (228 errors) ====
|
||||
// If one operand is the null or undefined value, it is treated as having the type of the
|
||||
// other operand.
|
||||
|
||||
@@ -705,10 +693,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
|
||||
// operator &
|
||||
var r8a1 = null & a;
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~
|
||||
!!! error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
var r8a2 = null & b;
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -721,10 +707,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var r8b1 = a & null;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~
|
||||
!!! error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
var r8b2 = b & null;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -737,10 +721,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var r8c1 = null & true;
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
var r8c2 = null & '';
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -753,10 +735,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var r8d1 = true & null;
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
var r8d2 = '' & null;
|
||||
~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -770,10 +750,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
|
||||
// operator ^
|
||||
var r9a1 = null ^ a;
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~
|
||||
!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
var r9a2 = null ^ b;
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -786,10 +764,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var r9b1 = a ^ null;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~
|
||||
!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
var r9b2 = b ^ null;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -802,10 +778,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var r9c1 = null ^ true;
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
var r9c2 = null ^ '';
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -818,10 +792,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var r9d1 = true ^ null;
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
var r9d2 = '' ^ null;
|
||||
~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -835,10 +807,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
|
||||
// operator |
|
||||
var r10a1 = null | a;
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~
|
||||
!!! error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
var r10a2 = null | b;
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -851,10 +821,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var r10b1 = a | null;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~
|
||||
!!! error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
var r10b2 = b | null;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -867,10 +835,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var r10c1 = null | true;
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
var r10c2 = null | '';
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -883,10 +849,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var r10d1 = true | null;
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
var r10d2 = '' | null;
|
||||
~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
+37
-73
@@ -166,81 +166,69 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(124,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(125,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(125,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(128,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(128,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(128,12): error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(129,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(129,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(130,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(130,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(132,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(132,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(132,12): error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(133,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(133,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(134,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(134,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(136,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(136,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(136,12): error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(137,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(137,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(138,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(138,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(140,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(140,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(140,12): error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(141,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(141,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(142,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(142,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(145,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(145,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(145,12): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(146,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(146,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(147,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(147,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(149,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(149,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(149,12): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(150,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(150,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(151,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(151,16): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(153,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(153,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(153,12): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(154,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(154,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(155,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(155,24): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(157,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(157,19): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(157,12): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(158,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(158,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(159,12): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(159,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(162,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(162,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(162,13): error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(163,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(163,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(164,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(164,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(166,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(166,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(166,13): error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(167,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(167,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(168,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(168,17): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(170,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(170,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(170,13): error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(171,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(171,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(172,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(172,25): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(174,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(174,20): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(174,13): error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(175,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(175,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(176,13): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts(176,18): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts (240 errors) ====
|
||||
==== tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeticOperatorWithUndefinedValueAndInvalidOperands.ts (228 errors) ====
|
||||
// If one operand is the undefined or undefined value, it is treated as having the type of the
|
||||
// other operand.
|
||||
|
||||
@@ -705,10 +693,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
|
||||
// operator &
|
||||
var r8a1 = undefined & a;
|
||||
~~~~~~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
var r8a2 = undefined & b;
|
||||
~~~~~~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -721,10 +707,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var r8b1 = a & undefined;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
var r8b2 = b & undefined;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -737,10 +721,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var r8c1 = undefined & true;
|
||||
~~~~~~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
var r8c2 = undefined & '';
|
||||
~~~~~~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -753,10 +735,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var r8d1 = true & undefined;
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2447: The '&' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
var r8d2 = '' & undefined;
|
||||
~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -770,10 +750,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
|
||||
// operator ^
|
||||
var r9a1 = undefined ^ a;
|
||||
~~~~~~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
var r9a2 = undefined ^ b;
|
||||
~~~~~~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -786,10 +764,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var r9b1 = a ^ undefined;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
var r9b2 = b ^ undefined;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -802,10 +778,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var r9c1 = undefined ^ true;
|
||||
~~~~~~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
var r9c2 = undefined ^ '';
|
||||
~~~~~~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -818,10 +792,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var r9d1 = true ^ undefined;
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
var r9d2 = '' ^ undefined;
|
||||
~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -835,10 +807,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
|
||||
// operator |
|
||||
var r10a1 = undefined | a;
|
||||
~~~~~~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
var r10a2 = undefined | b;
|
||||
~~~~~~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -851,10 +821,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var r10b1 = a | undefined;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
var r10b2 = b | undefined;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -867,10 +835,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var r10c1 = undefined | true;
|
||||
~~~~~~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
var r10c2 = undefined | '';
|
||||
~~~~~~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -883,10 +849,8 @@ tests/cases/conformance/expressions/binaryOperators/arithmeticOperator/arithmeti
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var r10d1 = true | undefined;
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2447: The '|' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
var r10d2 = '' | undefined;
|
||||
~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(17,1): error TS2322: Type '[number, string]' is not assignable to type 'number[]':
|
||||
Types of property 'pop' are incompatible:
|
||||
Type '() => {}' is not assignable to type '() => number':
|
||||
Type '{}' is not assignable to type 'number'.
|
||||
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts(18,1): error TS2322: Type '{}[]' is not assignable to type '[{}]':
|
||||
Property '0' is missing in type '{}[]'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/assignmentCompatBetweenTupleAndArray.ts (2 errors) ====
|
||||
var numStrTuple: [number, string];
|
||||
var numNumTuple: [number, number];
|
||||
var numEmptyObjTuple: [number, {}];
|
||||
var emptyObjTuple: [{}];
|
||||
|
||||
var numArray: number[];
|
||||
var emptyObjArray: {}[];
|
||||
|
||||
// no error
|
||||
numArray = numNumTuple;
|
||||
emptyObjArray = emptyObjTuple;
|
||||
emptyObjArray = numStrTuple;
|
||||
emptyObjArray = numNumTuple;
|
||||
emptyObjArray = numEmptyObjTuple;
|
||||
|
||||
// error
|
||||
numArray = numStrTuple;
|
||||
~~~~~~~~
|
||||
!!! error TS2322: Type '[number, string]' is not assignable to type 'number[]':
|
||||
!!! error TS2322: Types of property 'pop' are incompatible:
|
||||
!!! error TS2322: Type '() => {}' is not assignable to type '() => number':
|
||||
!!! error TS2322: Type '{}' is not assignable to type 'number'.
|
||||
emptyObjTuple = emptyObjArray;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '{}[]' is not assignable to type '[{}]':
|
||||
!!! error TS2322: Property '0' is missing in type '{}[]'.
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
//// [assignmentCompatBetweenTupleAndArray.ts]
|
||||
var numStrTuple: [number, string];
|
||||
var numNumTuple: [number, number];
|
||||
var numEmptyObjTuple: [number, {}];
|
||||
var emptyObjTuple: [{}];
|
||||
|
||||
var numArray: number[];
|
||||
var emptyObjArray: {}[];
|
||||
|
||||
// no error
|
||||
numArray = numNumTuple;
|
||||
emptyObjArray = emptyObjTuple;
|
||||
emptyObjArray = numStrTuple;
|
||||
emptyObjArray = numNumTuple;
|
||||
emptyObjArray = numEmptyObjTuple;
|
||||
|
||||
// error
|
||||
numArray = numStrTuple;
|
||||
emptyObjTuple = emptyObjArray;
|
||||
|
||||
|
||||
//// [assignmentCompatBetweenTupleAndArray.js]
|
||||
var numStrTuple;
|
||||
var numNumTuple;
|
||||
var numEmptyObjTuple;
|
||||
var emptyObjTuple;
|
||||
var numArray;
|
||||
var emptyObjArray;
|
||||
// no error
|
||||
numArray = numNumTuple;
|
||||
emptyObjArray = emptyObjTuple;
|
||||
emptyObjArray = numStrTuple;
|
||||
emptyObjArray = numNumTuple;
|
||||
emptyObjArray = numEmptyObjTuple;
|
||||
// error
|
||||
numArray = numStrTuple;
|
||||
emptyObjTuple = emptyObjArray;
|
||||
@@ -1,16 +1,22 @@
|
||||
tests/cases/compiler/augmentedTypesClass.ts(2,7): error TS2300: Duplicate identifier 'c1'.
|
||||
tests/cases/compiler/augmentedTypesClass.ts(3,5): error TS2300: Duplicate identifier 'c1'.
|
||||
tests/cases/compiler/augmentedTypesClass.ts(6,7): error TS2300: Duplicate identifier 'c4'.
|
||||
tests/cases/compiler/augmentedTypesClass.ts(7,6): error TS2300: Duplicate identifier 'c4'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/augmentedTypesClass.ts (2 errors) ====
|
||||
==== tests/cases/compiler/augmentedTypesClass.ts (4 errors) ====
|
||||
//// class then var
|
||||
class c1 { public foo() { } }
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'c1'.
|
||||
var c1 = 1; // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'c1'.
|
||||
|
||||
//// class then enum
|
||||
class c4 { public foo() { } }
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'c4'.
|
||||
enum c4 { One } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'c4'.
|
||||
@@ -1,12 +1,16 @@
|
||||
tests/cases/compiler/augmentedTypesClass2.ts(4,7): error TS2300: Duplicate identifier 'c11'.
|
||||
tests/cases/compiler/augmentedTypesClass2.ts(10,11): error TS2300: Duplicate identifier 'c11'.
|
||||
tests/cases/compiler/augmentedTypesClass2.ts(16,7): error TS2300: Duplicate identifier 'c33'.
|
||||
tests/cases/compiler/augmentedTypesClass2.ts(21,6): error TS2300: Duplicate identifier 'c33'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/augmentedTypesClass2.ts (2 errors) ====
|
||||
==== tests/cases/compiler/augmentedTypesClass2.ts (4 errors) ====
|
||||
// Checking class with other things in type space not value space
|
||||
|
||||
// class then interface
|
||||
class c11 {
|
||||
class c11 { // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'c11'.
|
||||
foo() {
|
||||
return 1;
|
||||
}
|
||||
@@ -21,6 +25,8 @@ tests/cases/compiler/augmentedTypesClass2.ts(21,6): error TS2300: Duplicate iden
|
||||
// class then class - covered
|
||||
// class then enum
|
||||
class c33 {
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'c33'.
|
||||
foo() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Checking class with other things in type space not value space
|
||||
|
||||
// class then interface
|
||||
class c11 {
|
||||
class c11 { // error
|
||||
foo() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
tests/cases/compiler/augmentedTypesClass2a.ts(2,7): error TS2300: Duplicate identifier 'c2'.
|
||||
tests/cases/compiler/augmentedTypesClass2a.ts(3,10): error TS2300: Duplicate identifier 'c2'.
|
||||
tests/cases/compiler/augmentedTypesClass2a.ts(4,5): error TS2300: Duplicate identifier 'c2'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/augmentedTypesClass2a.ts (2 errors) ====
|
||||
==== tests/cases/compiler/augmentedTypesClass2a.ts (3 errors) ====
|
||||
//// class then function
|
||||
class c2 { public foo() { } }
|
||||
class c2 { public foo() { } } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'c2'.
|
||||
function c2() { } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'c2'.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//// [augmentedTypesClass2a.ts]
|
||||
//// class then function
|
||||
class c2 { public foo() { } }
|
||||
class c2 { public foo() { } } // error
|
||||
function c2() { } // error
|
||||
var c2 = () => { }
|
||||
|
||||
@@ -12,7 +12,7 @@ var c2 = (function () {
|
||||
c2.prototype.foo = function () {
|
||||
};
|
||||
return c2;
|
||||
})();
|
||||
})(); // error
|
||||
function c2() {
|
||||
} // error
|
||||
var c2 = function () {
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
tests/cases/compiler/augmentedTypesClass4.ts(2,7): error TS2300: Duplicate identifier 'c3'.
|
||||
tests/cases/compiler/augmentedTypesClass4.ts(3,7): error TS2300: Duplicate identifier 'c3'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/augmentedTypesClass4.ts (1 errors) ====
|
||||
==== tests/cases/compiler/augmentedTypesClass4.ts (2 errors) ====
|
||||
//// class then class
|
||||
class c3 { public foo() { } }
|
||||
class c3 { public foo() { } } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'c3'.
|
||||
class c3 { public bar() { } } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'c3'.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//// [augmentedTypesClass4.ts]
|
||||
//// class then class
|
||||
class c3 { public foo() { } }
|
||||
class c3 { public foo() { } } // error
|
||||
class c3 { public bar() { } } // error
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ var c3 = (function () {
|
||||
c3.prototype.foo = function () {
|
||||
};
|
||||
return c3;
|
||||
})();
|
||||
})(); // error
|
||||
var c3 = (function () {
|
||||
function c3() {
|
||||
}
|
||||
|
||||
@@ -1,43 +1,58 @@
|
||||
tests/cases/compiler/augmentedTypesEnum.ts(2,6): error TS2300: Duplicate identifier 'e1111'.
|
||||
tests/cases/compiler/augmentedTypesEnum.ts(3,5): error TS2300: Duplicate identifier 'e1111'.
|
||||
tests/cases/compiler/augmentedTypesEnum.ts(6,6): error TS2300: Duplicate identifier 'e2'.
|
||||
tests/cases/compiler/augmentedTypesEnum.ts(7,10): error TS2300: Duplicate identifier 'e2'.
|
||||
tests/cases/compiler/augmentedTypesEnum.ts(9,6): error TS2300: Duplicate identifier 'e3'.
|
||||
tests/cases/compiler/augmentedTypesEnum.ts(10,5): error TS2300: Duplicate identifier 'e3'.
|
||||
tests/cases/compiler/augmentedTypesEnum.ts(13,6): error TS2300: Duplicate identifier 'e4'.
|
||||
tests/cases/compiler/augmentedTypesEnum.ts(14,7): error TS2300: Duplicate identifier 'e4'.
|
||||
tests/cases/compiler/augmentedTypesEnum.ts(18,11): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element.
|
||||
tests/cases/compiler/augmentedTypesEnum.ts(20,12): error TS2300: Duplicate identifier 'One'.
|
||||
tests/cases/compiler/augmentedTypesEnum.ts(21,12): error TS2300: Duplicate identifier 'One'.
|
||||
tests/cases/compiler/augmentedTypesEnum.ts(21,12): error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element.
|
||||
|
||||
|
||||
==== tests/cases/compiler/augmentedTypesEnum.ts (7 errors) ====
|
||||
==== tests/cases/compiler/augmentedTypesEnum.ts (12 errors) ====
|
||||
// enum then var
|
||||
enum e1111 { One }
|
||||
enum e1111 { One } // error
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'e1111'.
|
||||
var e1111 = 1; // error
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'e1111'.
|
||||
|
||||
// enum then function
|
||||
enum e2 { One }
|
||||
enum e2 { One } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'e2'.
|
||||
function e2() { } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'e2'.
|
||||
|
||||
enum e3 { One }
|
||||
enum e3 { One } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'e3'.
|
||||
var e3 = () => { } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'e3'.
|
||||
|
||||
// enum then class
|
||||
enum e4 { One }
|
||||
enum e4 { One } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'e4'.
|
||||
class e4 { public foo() { } } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'e4'.
|
||||
|
||||
// enum then enum
|
||||
enum e5 { One }
|
||||
enum e5 { Two }
|
||||
enum e5 { Two } // error
|
||||
~~~
|
||||
!!! error TS2432: In an enum with multiple declarations, only one declaration can omit an initializer for its first enum element.
|
||||
|
||||
enum e5a { One }
|
||||
enum e5a { One } // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'One'.
|
||||
enum e5a { One } // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'One'.
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
//// [augmentedTypesEnum.ts]
|
||||
// enum then var
|
||||
enum e1111 { One }
|
||||
enum e1111 { One } // error
|
||||
var e1111 = 1; // error
|
||||
|
||||
// enum then function
|
||||
enum e2 { One }
|
||||
enum e2 { One } // error
|
||||
function e2() { } // error
|
||||
|
||||
enum e3 { One }
|
||||
enum e3 { One } // error
|
||||
var e3 = () => { } // error
|
||||
|
||||
// enum then class
|
||||
enum e4 { One }
|
||||
enum e4 { One } // error
|
||||
class e4 { public foo() { } } // error
|
||||
|
||||
// enum then enum
|
||||
enum e5 { One }
|
||||
enum e5 { Two }
|
||||
enum e5 { Two } // error
|
||||
|
||||
enum e5a { One }
|
||||
enum e5a { One } // error
|
||||
enum e5a { One } // error
|
||||
|
||||
// enum then internal module
|
||||
@@ -40,26 +40,26 @@ module e6b { export var y = 2; } // should be error
|
||||
var e1111;
|
||||
(function (e1111) {
|
||||
e1111[e1111["One"] = 0] = "One";
|
||||
})(e1111 || (e1111 = {}));
|
||||
})(e1111 || (e1111 = {})); // error
|
||||
var e1111 = 1; // error
|
||||
// enum then function
|
||||
var e2;
|
||||
(function (e2) {
|
||||
e2[e2["One"] = 0] = "One";
|
||||
})(e2 || (e2 = {}));
|
||||
})(e2 || (e2 = {})); // error
|
||||
function e2() {
|
||||
} // error
|
||||
var e3;
|
||||
(function (e3) {
|
||||
e3[e3["One"] = 0] = "One";
|
||||
})(e3 || (e3 = {}));
|
||||
})(e3 || (e3 = {})); // error
|
||||
var e3 = function () {
|
||||
}; // error
|
||||
// enum then class
|
||||
var e4;
|
||||
(function (e4) {
|
||||
e4[e4["One"] = 0] = "One";
|
||||
})(e4 || (e4 = {}));
|
||||
})(e4 || (e4 = {})); // error
|
||||
var e4 = (function () {
|
||||
function e4() {
|
||||
}
|
||||
@@ -75,11 +75,11 @@ var e5;
|
||||
var e5;
|
||||
(function (e5) {
|
||||
e5[e5["Two"] = 0] = "Two";
|
||||
})(e5 || (e5 = {}));
|
||||
})(e5 || (e5 = {})); // error
|
||||
var e5a;
|
||||
(function (e5a) {
|
||||
e5a[e5a["One"] = 0] = "One";
|
||||
})(e5a || (e5a = {}));
|
||||
})(e5a || (e5a = {})); // error
|
||||
var e5a;
|
||||
(function (e5a) {
|
||||
e5a[e5a["One"] = 0] = "One";
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
tests/cases/compiler/augmentedTypesEnum2.ts(2,6): error TS2300: Duplicate identifier 'e1'.
|
||||
tests/cases/compiler/augmentedTypesEnum2.ts(4,11): error TS2300: Duplicate identifier 'e1'.
|
||||
tests/cases/compiler/augmentedTypesEnum2.ts(11,6): error TS2300: Duplicate identifier 'e2'.
|
||||
tests/cases/compiler/augmentedTypesEnum2.ts(12,7): error TS2300: Duplicate identifier 'e2'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/augmentedTypesEnum2.ts (2 errors) ====
|
||||
==== tests/cases/compiler/augmentedTypesEnum2.ts (4 errors) ====
|
||||
// enum then interface
|
||||
enum e1 { One }
|
||||
enum e1 { One } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'e1'.
|
||||
|
||||
interface e1 {
|
||||
interface e1 { // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'e1'.
|
||||
foo(): void;
|
||||
@@ -15,7 +19,9 @@ tests/cases/compiler/augmentedTypesEnum2.ts(12,7): error TS2300: Duplicate ident
|
||||
// interface then enum works
|
||||
|
||||
// enum then class
|
||||
enum e2 { One };
|
||||
enum e2 { One }; // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'e2'.
|
||||
class e2 { // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'e2'.
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
//// [augmentedTypesEnum2.ts]
|
||||
// enum then interface
|
||||
enum e1 { One }
|
||||
enum e1 { One } // error
|
||||
|
||||
interface e1 {
|
||||
interface e1 { // error
|
||||
foo(): void;
|
||||
}
|
||||
|
||||
// interface then enum works
|
||||
|
||||
// enum then class
|
||||
enum e2 { One };
|
||||
enum e2 { One }; // error
|
||||
class e2 { // error
|
||||
foo() {
|
||||
return 1;
|
||||
@@ -24,7 +24,7 @@ class e2 { // error
|
||||
var e1;
|
||||
(function (e1) {
|
||||
e1[e1["One"] = 0] = "One";
|
||||
})(e1 || (e1 = {}));
|
||||
})(e1 || (e1 = {})); // error
|
||||
// interface then enum works
|
||||
// enum then class
|
||||
var e2;
|
||||
|
||||
@@ -1,42 +1,60 @@
|
||||
tests/cases/compiler/augmentedTypesFunction.ts(2,10): error TS2300: Duplicate identifier 'y1'.
|
||||
tests/cases/compiler/augmentedTypesFunction.ts(3,5): error TS2300: Duplicate identifier 'y1'.
|
||||
tests/cases/compiler/augmentedTypesFunction.ts(7,1): error TS2393: Duplicate function implementation.
|
||||
tests/cases/compiler/augmentedTypesFunction.ts(6,10): error TS2393: Duplicate function implementation.
|
||||
tests/cases/compiler/augmentedTypesFunction.ts(7,10): error TS2393: Duplicate function implementation.
|
||||
tests/cases/compiler/augmentedTypesFunction.ts(9,10): error TS2300: Duplicate identifier 'y2a'.
|
||||
tests/cases/compiler/augmentedTypesFunction.ts(10,5): error TS2300: Duplicate identifier 'y2a'.
|
||||
tests/cases/compiler/augmentedTypesFunction.ts(13,10): error TS2300: Duplicate identifier 'y3'.
|
||||
tests/cases/compiler/augmentedTypesFunction.ts(14,7): error TS2300: Duplicate identifier 'y3'.
|
||||
tests/cases/compiler/augmentedTypesFunction.ts(16,10): error TS2300: Duplicate identifier 'y3a'.
|
||||
tests/cases/compiler/augmentedTypesFunction.ts(17,7): error TS2300: Duplicate identifier 'y3a'.
|
||||
tests/cases/compiler/augmentedTypesFunction.ts(20,10): error TS2300: Duplicate identifier 'y4'.
|
||||
tests/cases/compiler/augmentedTypesFunction.ts(21,6): error TS2300: Duplicate identifier 'y4'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/augmentedTypesFunction.ts (6 errors) ====
|
||||
==== tests/cases/compiler/augmentedTypesFunction.ts (12 errors) ====
|
||||
// function then var
|
||||
function y1() { }
|
||||
function y1() { } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'y1'.
|
||||
var y1 = 1; // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'y1'.
|
||||
|
||||
// function then function
|
||||
function y2() { }
|
||||
function y2() { } // error
|
||||
~~~~~~~~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
function y2() { } // error
|
||||
~~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
|
||||
function y2a() { }
|
||||
function y2a() { } // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'y2a'.
|
||||
var y2a = () => { } // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'y2a'.
|
||||
|
||||
// function then class
|
||||
function y3() { }
|
||||
function y3() { } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'y3'.
|
||||
class y3 { } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'y3'.
|
||||
|
||||
function y3a() { }
|
||||
function y3a() { } // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'y3a'.
|
||||
class y3a { public foo() { } } // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'y3a'.
|
||||
|
||||
// function then enum
|
||||
function y4() { }
|
||||
function y4() { } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'y4'.
|
||||
enum y4 { One } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'y4'.
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
//// [augmentedTypesFunction.ts]
|
||||
// function then var
|
||||
function y1() { }
|
||||
function y1() { } // error
|
||||
var y1 = 1; // error
|
||||
|
||||
// function then function
|
||||
function y2() { }
|
||||
function y2() { } // error
|
||||
function y2() { } // error
|
||||
|
||||
function y2a() { }
|
||||
function y2a() { } // error
|
||||
var y2a = () => { } // error
|
||||
|
||||
// function then class
|
||||
function y3() { }
|
||||
function y3() { } // error
|
||||
class y3 { } // error
|
||||
|
||||
function y3a() { }
|
||||
function y3a() { } // error
|
||||
class y3a { public foo() { } } // error
|
||||
|
||||
// function then enum
|
||||
function y4() { }
|
||||
function y4() { } // error
|
||||
enum y4 { One } // error
|
||||
|
||||
// function then internal module
|
||||
@@ -41,27 +41,27 @@ module y5c { export interface I { foo(): void } } // should be an error
|
||||
//// [augmentedTypesFunction.js]
|
||||
// function then var
|
||||
function y1() {
|
||||
}
|
||||
} // error
|
||||
var y1 = 1; // error
|
||||
// function then function
|
||||
function y2() {
|
||||
}
|
||||
} // error
|
||||
function y2() {
|
||||
} // error
|
||||
function y2a() {
|
||||
}
|
||||
} // error
|
||||
var y2a = function () {
|
||||
}; // error
|
||||
// function then class
|
||||
function y3() {
|
||||
}
|
||||
} // error
|
||||
var y3 = (function () {
|
||||
function y3() {
|
||||
}
|
||||
return y3;
|
||||
})(); // error
|
||||
function y3a() {
|
||||
}
|
||||
} // error
|
||||
var y3a = (function () {
|
||||
function y3a() {
|
||||
}
|
||||
@@ -71,7 +71,7 @@ var y3a = (function () {
|
||||
})(); // error
|
||||
// function then enum
|
||||
function y4() {
|
||||
}
|
||||
} // error
|
||||
var y4;
|
||||
(function (y4) {
|
||||
y4[y4["One"] = 0] = "One";
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
tests/cases/compiler/augmentedTypesInterface.ts(12,11): error TS2300: Duplicate identifier 'i2'.
|
||||
tests/cases/compiler/augmentedTypesInterface.ts(16,7): error TS2300: Duplicate identifier 'i2'.
|
||||
tests/cases/compiler/augmentedTypesInterface.ts(23,11): error TS2300: Duplicate identifier 'i3'.
|
||||
tests/cases/compiler/augmentedTypesInterface.ts(26,6): error TS2300: Duplicate identifier 'i3'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/augmentedTypesInterface.ts (2 errors) ====
|
||||
==== tests/cases/compiler/augmentedTypesInterface.ts (4 errors) ====
|
||||
// interface then interface
|
||||
|
||||
interface i {
|
||||
@@ -14,7 +16,9 @@ tests/cases/compiler/augmentedTypesInterface.ts(26,6): error TS2300: Duplicate i
|
||||
}
|
||||
|
||||
// interface then class
|
||||
interface i2 {
|
||||
interface i2 { // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'i2'.
|
||||
foo(): void;
|
||||
}
|
||||
|
||||
@@ -27,7 +31,9 @@ tests/cases/compiler/augmentedTypesInterface.ts(26,6): error TS2300: Duplicate i
|
||||
}
|
||||
|
||||
// interface then enum
|
||||
interface i3 {
|
||||
interface i3 { // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'i3'.
|
||||
foo(): void;
|
||||
}
|
||||
enum i3 { One }; // error
|
||||
|
||||
@@ -10,7 +10,7 @@ interface i {
|
||||
}
|
||||
|
||||
// interface then class
|
||||
interface i2 {
|
||||
interface i2 { // error
|
||||
foo(): void;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ class i2 { // error
|
||||
}
|
||||
|
||||
// interface then enum
|
||||
interface i3 {
|
||||
interface i3 { // error
|
||||
foo(): void;
|
||||
}
|
||||
enum i3 { One }; // error
|
||||
|
||||
@@ -1,23 +1,30 @@
|
||||
tests/cases/compiler/augmentedTypesModules.ts(5,8): error TS2300: Duplicate identifier 'm1a'.
|
||||
tests/cases/compiler/augmentedTypesModules.ts(6,5): error TS2300: Duplicate identifier 'm1a'.
|
||||
tests/cases/compiler/augmentedTypesModules.ts(8,8): error TS2300: Duplicate identifier 'm1b'.
|
||||
tests/cases/compiler/augmentedTypesModules.ts(9,5): error TS2300: Duplicate identifier 'm1b'.
|
||||
tests/cases/compiler/augmentedTypesModules.ts(16,8): error TS2300: Duplicate identifier 'm1d'.
|
||||
tests/cases/compiler/augmentedTypesModules.ts(19,5): error TS2300: Duplicate identifier 'm1d'.
|
||||
tests/cases/compiler/augmentedTypesModules.ts(25,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged
|
||||
tests/cases/compiler/augmentedTypesModules.ts(28,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged
|
||||
tests/cases/compiler/augmentedTypesModules.ts(51,8): error TS2434: A module declaration cannot be located prior to a class or function with which it is merged
|
||||
|
||||
|
||||
==== tests/cases/compiler/augmentedTypesModules.ts (6 errors) ====
|
||||
==== tests/cases/compiler/augmentedTypesModules.ts (9 errors) ====
|
||||
// module then var
|
||||
module m1 { }
|
||||
var m1 = 1; // Should be allowed
|
||||
|
||||
module m1a { var y = 2; }
|
||||
var m1a = 1;
|
||||
module m1a { var y = 2; } // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'm1a'.
|
||||
var m1a = 1; // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'm1a'.
|
||||
|
||||
module m1b { export var y = 2; }
|
||||
var m1b = 1;
|
||||
module m1b { export var y = 2; } // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'm1b'.
|
||||
var m1b = 1; // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'm1b'.
|
||||
|
||||
@@ -26,7 +33,9 @@ tests/cases/compiler/augmentedTypesModules.ts(51,8): error TS2434: A module decl
|
||||
}
|
||||
var m1c = 1; // Should be allowed
|
||||
|
||||
module m1d {
|
||||
module m1d { // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'm1d'.
|
||||
export class I { foo() { } }
|
||||
}
|
||||
var m1d = 1; // error
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
module m1 { }
|
||||
var m1 = 1; // Should be allowed
|
||||
|
||||
module m1a { var y = 2; }
|
||||
var m1a = 1;
|
||||
module m1a { var y = 2; } // error
|
||||
var m1a = 1; // error
|
||||
|
||||
module m1b { export var y = 2; }
|
||||
var m1b = 1;
|
||||
module m1b { export var y = 2; } // error
|
||||
var m1b = 1; // error
|
||||
|
||||
module m1c {
|
||||
export interface I { foo(): void; }
|
||||
}
|
||||
var m1c = 1; // Should be allowed
|
||||
|
||||
module m1d {
|
||||
module m1d { // error
|
||||
export class I { foo() { } }
|
||||
}
|
||||
var m1d = 1; // error
|
||||
@@ -102,13 +102,13 @@ var m1 = 1; // Should be allowed
|
||||
var m1a;
|
||||
(function (m1a) {
|
||||
var y = 2;
|
||||
})(m1a || (m1a = {}));
|
||||
var m1a = 1;
|
||||
})(m1a || (m1a = {})); // error
|
||||
var m1a = 1; // error
|
||||
var m1b;
|
||||
(function (m1b) {
|
||||
m1b.y = 2;
|
||||
})(m1b || (m1b = {}));
|
||||
var m1b = 1;
|
||||
})(m1b || (m1b = {})); // error
|
||||
var m1b = 1; // error
|
||||
var m1c = 1; // Should be allowed
|
||||
var m1d;
|
||||
(function (m1d) {
|
||||
|
||||
@@ -1,41 +1,55 @@
|
||||
tests/cases/compiler/augmentedTypesVar.ts(6,5): error TS2300: Duplicate identifier 'x2'.
|
||||
tests/cases/compiler/augmentedTypesVar.ts(7,10): error TS2300: Duplicate identifier 'x2'.
|
||||
tests/cases/compiler/augmentedTypesVar.ts(10,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' must be of type 'number', but here has type '() => void'.
|
||||
tests/cases/compiler/augmentedTypesVar.ts(13,5): error TS2300: Duplicate identifier 'x4'.
|
||||
tests/cases/compiler/augmentedTypesVar.ts(14,7): error TS2300: Duplicate identifier 'x4'.
|
||||
tests/cases/compiler/augmentedTypesVar.ts(16,5): error TS2300: Duplicate identifier 'x4a'.
|
||||
tests/cases/compiler/augmentedTypesVar.ts(17,7): error TS2300: Duplicate identifier 'x4a'.
|
||||
tests/cases/compiler/augmentedTypesVar.ts(20,5): error TS2300: Duplicate identifier 'x5'.
|
||||
tests/cases/compiler/augmentedTypesVar.ts(21,6): error TS2300: Duplicate identifier 'x5'.
|
||||
tests/cases/compiler/augmentedTypesVar.ts(27,5): error TS2300: Duplicate identifier 'x6a'.
|
||||
tests/cases/compiler/augmentedTypesVar.ts(28,8): error TS2300: Duplicate identifier 'x6a'.
|
||||
tests/cases/compiler/augmentedTypesVar.ts(30,5): error TS2300: Duplicate identifier 'x6b'.
|
||||
tests/cases/compiler/augmentedTypesVar.ts(31,8): error TS2300: Duplicate identifier 'x6b'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/augmentedTypesVar.ts (7 errors) ====
|
||||
==== tests/cases/compiler/augmentedTypesVar.ts (13 errors) ====
|
||||
// var then var
|
||||
var x1 = 1;
|
||||
var x1 = 2;
|
||||
|
||||
// var then function
|
||||
var x2 = 1;
|
||||
function x2() { } // should be an error
|
||||
var x2 = 1; // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'x2'.
|
||||
function x2() { } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'x2'.
|
||||
|
||||
var x3 = 1;
|
||||
var x3 = () => { } // should be an error
|
||||
var x3 = 1;
|
||||
var x3 = () => { } // error
|
||||
~~
|
||||
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' must be of type 'number', but here has type '() => void'.
|
||||
|
||||
// var then class
|
||||
var x4 = 1;
|
||||
var x4 = 1; // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'x4'.
|
||||
class x4 { } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'x4'.
|
||||
|
||||
var x4a = 1;
|
||||
var x4a = 1; // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'x4a'.
|
||||
class x4a { public foo() { } } // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'x4a'.
|
||||
|
||||
// var then enum
|
||||
var x5 = 1;
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'x5'.
|
||||
enum x5 { One } // error
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'x5'.
|
||||
@@ -44,12 +58,16 @@ tests/cases/compiler/augmentedTypesVar.ts(31,8): error TS2300: Duplicate identif
|
||||
var x6 = 1;
|
||||
module x6 { } // ok since non-instantiated
|
||||
|
||||
var x6a = 1;
|
||||
var x6a = 1; // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'x6a'.
|
||||
module x6a { var y = 2; } // error since instantiated
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'x6a'.
|
||||
|
||||
var x6b = 1;
|
||||
var x6b = 1; // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'x6b'.
|
||||
module x6b { export var y = 2; } // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'x6b'.
|
||||
|
||||
@@ -4,17 +4,17 @@ var x1 = 1;
|
||||
var x1 = 2;
|
||||
|
||||
// var then function
|
||||
var x2 = 1;
|
||||
function x2() { } // should be an error
|
||||
var x2 = 1; // error
|
||||
function x2() { } // error
|
||||
|
||||
var x3 = 1;
|
||||
var x3 = () => { } // should be an error
|
||||
var x3 = 1;
|
||||
var x3 = () => { } // error
|
||||
|
||||
// var then class
|
||||
var x4 = 1;
|
||||
var x4 = 1; // error
|
||||
class x4 { } // error
|
||||
|
||||
var x4a = 1;
|
||||
var x4a = 1; // error
|
||||
class x4a { public foo() { } } // error
|
||||
|
||||
// var then enum
|
||||
@@ -25,10 +25,10 @@ enum x5 { One } // error
|
||||
var x6 = 1;
|
||||
module x6 { } // ok since non-instantiated
|
||||
|
||||
var x6a = 1;
|
||||
var x6a = 1; // error
|
||||
module x6a { var y = 2; } // error since instantiated
|
||||
|
||||
var x6b = 1;
|
||||
var x6b = 1; // error
|
||||
module x6b { export var y = 2; } // error
|
||||
|
||||
// var then import, messes with other error reporting
|
||||
@@ -41,20 +41,20 @@ module x6b { export var y = 2; } // error
|
||||
var x1 = 1;
|
||||
var x1 = 2;
|
||||
// var then function
|
||||
var x2 = 1;
|
||||
var x2 = 1; // error
|
||||
function x2() {
|
||||
} // should be an error
|
||||
} // error
|
||||
var x3 = 1;
|
||||
var x3 = function () {
|
||||
}; // should be an error
|
||||
}; // error
|
||||
// var then class
|
||||
var x4 = 1;
|
||||
var x4 = 1; // error
|
||||
var x4 = (function () {
|
||||
function x4() {
|
||||
}
|
||||
return x4;
|
||||
})(); // error
|
||||
var x4a = 1;
|
||||
var x4a = 1; // error
|
||||
var x4a = (function () {
|
||||
function x4a() {
|
||||
}
|
||||
@@ -70,12 +70,12 @@ var x5;
|
||||
})(x5 || (x5 = {})); // error
|
||||
// var then module
|
||||
var x6 = 1;
|
||||
var x6a = 1;
|
||||
var x6a = 1; // error
|
||||
var x6a;
|
||||
(function (x6a) {
|
||||
var y = 2;
|
||||
})(x6a || (x6a = {})); // error since instantiated
|
||||
var x6b = 1;
|
||||
var x6b = 1; // error
|
||||
var x6b;
|
||||
(function (x6b) {
|
||||
x6b.y = 2;
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
//// [bestCommonTypeOfTuple.ts]
|
||||
function f1(x: number): string { return "foo"; }
|
||||
|
||||
function f2(x: number): number { return 10; }
|
||||
|
||||
function f3(x: number): boolean { return true; }
|
||||
|
||||
enum E1 { one }
|
||||
|
||||
enum E2 { two }
|
||||
|
||||
|
||||
var t1: [(x: number) => string, (x: number) => number];
|
||||
var t2: [E1, E2];
|
||||
var t3: [number, any];
|
||||
var t4: [E1, E2, number];
|
||||
|
||||
// no error
|
||||
t1 = [f1, f2];
|
||||
t2 = [E1.one, E2.two];
|
||||
t3 = [5, undefined];
|
||||
t4 = [E1.one, E2.two, 20];
|
||||
var e1 = t1[2]; // {}
|
||||
var e2 = t2[2]; // {}
|
||||
var e3 = t3[2]; // any
|
||||
var e4 = t4[3]; // number
|
||||
|
||||
//// [bestCommonTypeOfTuple.js]
|
||||
function f1(x) {
|
||||
return "foo";
|
||||
}
|
||||
function f2(x) {
|
||||
return 10;
|
||||
}
|
||||
function f3(x) {
|
||||
return true;
|
||||
}
|
||||
var E1;
|
||||
(function (E1) {
|
||||
E1[E1["one"] = 0] = "one";
|
||||
})(E1 || (E1 = {}));
|
||||
var E2;
|
||||
(function (E2) {
|
||||
E2[E2["two"] = 0] = "two";
|
||||
})(E2 || (E2 = {}));
|
||||
var t1;
|
||||
var t2;
|
||||
var t3;
|
||||
var t4;
|
||||
// no error
|
||||
t1 = [f1, f2];
|
||||
t2 = [0 /* one */, 0 /* two */];
|
||||
t3 = [5, undefined];
|
||||
t4 = [0 /* one */, 0 /* two */, 20];
|
||||
var e1 = t1[2]; // {}
|
||||
var e2 = t2[2]; // {}
|
||||
var e3 = t3[2]; // any
|
||||
var e4 = t4[3]; // number
|
||||
@@ -0,0 +1,96 @@
|
||||
=== tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple.ts ===
|
||||
function f1(x: number): string { return "foo"; }
|
||||
>f1 : (x: number) => string
|
||||
>x : number
|
||||
|
||||
function f2(x: number): number { return 10; }
|
||||
>f2 : (x: number) => number
|
||||
>x : number
|
||||
|
||||
function f3(x: number): boolean { return true; }
|
||||
>f3 : (x: number) => boolean
|
||||
>x : number
|
||||
|
||||
enum E1 { one }
|
||||
>E1 : E1
|
||||
>one : E1
|
||||
|
||||
enum E2 { two }
|
||||
>E2 : E2
|
||||
>two : E2
|
||||
|
||||
|
||||
var t1: [(x: number) => string, (x: number) => number];
|
||||
>t1 : [(x: number) => string, (x: number) => number]
|
||||
>x : number
|
||||
>x : number
|
||||
|
||||
var t2: [E1, E2];
|
||||
>t2 : [E1, E2]
|
||||
>E1 : E1
|
||||
>E2 : E2
|
||||
|
||||
var t3: [number, any];
|
||||
>t3 : [number, any]
|
||||
|
||||
var t4: [E1, E2, number];
|
||||
>t4 : [E1, E2, number]
|
||||
>E1 : E1
|
||||
>E2 : E2
|
||||
|
||||
// no error
|
||||
t1 = [f1, f2];
|
||||
>t1 = [f1, f2] : [(x: number) => string, (x: number) => number]
|
||||
>t1 : [(x: number) => string, (x: number) => number]
|
||||
>[f1, f2] : [(x: number) => string, (x: number) => number]
|
||||
>f1 : (x: number) => string
|
||||
>f2 : (x: number) => number
|
||||
|
||||
t2 = [E1.one, E2.two];
|
||||
>t2 = [E1.one, E2.two] : [E1, E2]
|
||||
>t2 : [E1, E2]
|
||||
>[E1.one, E2.two] : [E1, E2]
|
||||
>E1.one : E1
|
||||
>E1 : typeof E1
|
||||
>one : E1
|
||||
>E2.two : E2
|
||||
>E2 : typeof E2
|
||||
>two : E2
|
||||
|
||||
t3 = [5, undefined];
|
||||
>t3 = [5, undefined] : [number, undefined]
|
||||
>t3 : [number, any]
|
||||
>[5, undefined] : [number, undefined]
|
||||
>undefined : undefined
|
||||
|
||||
t4 = [E1.one, E2.two, 20];
|
||||
>t4 = [E1.one, E2.two, 20] : [E1, E2, number]
|
||||
>t4 : [E1, E2, number]
|
||||
>[E1.one, E2.two, 20] : [E1, E2, number]
|
||||
>E1.one : E1
|
||||
>E1 : typeof E1
|
||||
>one : E1
|
||||
>E2.two : E2
|
||||
>E2 : typeof E2
|
||||
>two : E2
|
||||
|
||||
var e1 = t1[2]; // {}
|
||||
>e1 : {}
|
||||
>t1[2] : {}
|
||||
>t1 : [(x: number) => string, (x: number) => number]
|
||||
|
||||
var e2 = t2[2]; // {}
|
||||
>e2 : {}
|
||||
>t2[2] : {}
|
||||
>t2 : [E1, E2]
|
||||
|
||||
var e3 = t3[2]; // any
|
||||
>e3 : any
|
||||
>t3[2] : any
|
||||
>t3 : [number, any]
|
||||
|
||||
var e4 = t4[3]; // number
|
||||
>e4 : number
|
||||
>t4[3] : number
|
||||
>t4 : [E1, E2, number]
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
//// [bestCommonTypeOfTuple2.ts]
|
||||
interface base { }
|
||||
interface base1 { i }
|
||||
class C implements base { c }
|
||||
class D implements base { d }
|
||||
class E implements base { e }
|
||||
class F extends C { f }
|
||||
|
||||
class C1 implements base1 { i = "foo"; c }
|
||||
class D1 extends C1 { i = "bar"; d }
|
||||
|
||||
var t1: [C, base];
|
||||
var t2: [C, D];
|
||||
var t3: [C1, D1];
|
||||
var t4: [base1, C1];
|
||||
var t5: [C1, F]
|
||||
|
||||
var e11 = t1[4]; // base
|
||||
var e21 = t2[4]; // {}
|
||||
var e31 = t3[4]; // C1
|
||||
var e41 = t4[2]; // base1
|
||||
var e51 = t5[2]; // {}
|
||||
|
||||
|
||||
//// [bestCommonTypeOfTuple2.js]
|
||||
var __extends = this.__extends || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
};
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
return C;
|
||||
})();
|
||||
var D = (function () {
|
||||
function D() {
|
||||
}
|
||||
return D;
|
||||
})();
|
||||
var E = (function () {
|
||||
function E() {
|
||||
}
|
||||
return E;
|
||||
})();
|
||||
var F = (function (_super) {
|
||||
__extends(F, _super);
|
||||
function F() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return F;
|
||||
})(C);
|
||||
var C1 = (function () {
|
||||
function C1() {
|
||||
this.i = "foo";
|
||||
}
|
||||
return C1;
|
||||
})();
|
||||
var D1 = (function (_super) {
|
||||
__extends(D1, _super);
|
||||
function D1() {
|
||||
_super.apply(this, arguments);
|
||||
this.i = "bar";
|
||||
}
|
||||
return D1;
|
||||
})(C1);
|
||||
var t1;
|
||||
var t2;
|
||||
var t3;
|
||||
var t4;
|
||||
var t5;
|
||||
var e11 = t1[4]; // base
|
||||
var e21 = t2[4]; // {}
|
||||
var e31 = t3[4]; // C1
|
||||
var e41 = t4[2]; // base1
|
||||
var e51 = t5[2]; // {}
|
||||
@@ -0,0 +1,90 @@
|
||||
=== tests/cases/conformance/types/typeRelationships/bestCommonType/bestCommonTypeOfTuple2.ts ===
|
||||
interface base { }
|
||||
>base : base
|
||||
|
||||
interface base1 { i }
|
||||
>base1 : base1
|
||||
>i : any
|
||||
|
||||
class C implements base { c }
|
||||
>C : C
|
||||
>base : base
|
||||
>c : any
|
||||
|
||||
class D implements base { d }
|
||||
>D : D
|
||||
>base : base
|
||||
>d : any
|
||||
|
||||
class E implements base { e }
|
||||
>E : E
|
||||
>base : base
|
||||
>e : any
|
||||
|
||||
class F extends C { f }
|
||||
>F : F
|
||||
>C : C
|
||||
>f : any
|
||||
|
||||
class C1 implements base1 { i = "foo"; c }
|
||||
>C1 : C1
|
||||
>base1 : base1
|
||||
>i : string
|
||||
>c : any
|
||||
|
||||
class D1 extends C1 { i = "bar"; d }
|
||||
>D1 : D1
|
||||
>C1 : C1
|
||||
>i : string
|
||||
>d : any
|
||||
|
||||
var t1: [C, base];
|
||||
>t1 : [C, base]
|
||||
>C : C
|
||||
>base : base
|
||||
|
||||
var t2: [C, D];
|
||||
>t2 : [C, D]
|
||||
>C : C
|
||||
>D : D
|
||||
|
||||
var t3: [C1, D1];
|
||||
>t3 : [C1, D1]
|
||||
>C1 : C1
|
||||
>D1 : D1
|
||||
|
||||
var t4: [base1, C1];
|
||||
>t4 : [base1, C1]
|
||||
>base1 : base1
|
||||
>C1 : C1
|
||||
|
||||
var t5: [C1, F]
|
||||
>t5 : [C1, F]
|
||||
>C1 : C1
|
||||
>F : F
|
||||
|
||||
var e11 = t1[4]; // base
|
||||
>e11 : base
|
||||
>t1[4] : base
|
||||
>t1 : [C, base]
|
||||
|
||||
var e21 = t2[4]; // {}
|
||||
>e21 : {}
|
||||
>t2[4] : {}
|
||||
>t2 : [C, D]
|
||||
|
||||
var e31 = t3[4]; // C1
|
||||
>e31 : C1
|
||||
>t3[4] : C1
|
||||
>t3 : [C1, D1]
|
||||
|
||||
var e41 = t4[2]; // base1
|
||||
>e41 : base1
|
||||
>t4[2] : base1
|
||||
>t4 : [base1, C1]
|
||||
|
||||
var e51 = t5[2]; // {}
|
||||
>e51 : {}
|
||||
>t5[2] : {}
|
||||
>t5 : [C1, F]
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
tests/cases/compiler/bitwiseCompoundAssignmentOperators.ts(3,1): error TS2447: The '^=' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
tests/cases/compiler/bitwiseCompoundAssignmentOperators.ts(7,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/compiler/bitwiseCompoundAssignmentOperators.ts(9,6): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/compiler/bitwiseCompoundAssignmentOperators.ts(14,1): error TS2447: The '&=' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
tests/cases/compiler/bitwiseCompoundAssignmentOperators.ts(18,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/compiler/bitwiseCompoundAssignmentOperators.ts(20,6): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/compiler/bitwiseCompoundAssignmentOperators.ts(24,1): error TS2447: The '|=' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
tests/cases/compiler/bitwiseCompoundAssignmentOperators.ts(28,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
|
||||
==== tests/cases/compiler/bitwiseCompoundAssignmentOperators.ts (8 errors) ====
|
||||
var a = true;
|
||||
var b = 1;
|
||||
a ^= a;
|
||||
~~~~~~
|
||||
!!! error TS2447: The '^=' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
a = true;
|
||||
b ^= b;
|
||||
b = 1;
|
||||
a ^= b;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
a = true;
|
||||
b ^= a;
|
||||
~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
b = 1;
|
||||
|
||||
var c = false;
|
||||
var d = 2;
|
||||
c &= c;
|
||||
~~~~~~
|
||||
!!! error TS2447: The '&=' operator is not allowed for boolean types. Consider using '&&' instead.
|
||||
c = false;
|
||||
d &= d;
|
||||
d = 2;
|
||||
c &= d;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
c = false;
|
||||
d &= c;
|
||||
~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
var e = true;
|
||||
var f = 0;
|
||||
e |= e;
|
||||
~~~~~~
|
||||
!!! error TS2447: The '|=' operator is not allowed for boolean types. Consider using '||' instead.
|
||||
e = true;
|
||||
f |= f;
|
||||
f = 0;
|
||||
e |= f;
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
e = true;
|
||||
f |= f;
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
//// [bitwiseCompoundAssignmentOperators.ts]
|
||||
var a = true;
|
||||
var b = 1;
|
||||
a ^= a;
|
||||
a = true;
|
||||
b ^= b;
|
||||
b = 1;
|
||||
a ^= b;
|
||||
a = true;
|
||||
b ^= a;
|
||||
b = 1;
|
||||
|
||||
var c = false;
|
||||
var d = 2;
|
||||
c &= c;
|
||||
c = false;
|
||||
d &= d;
|
||||
d = 2;
|
||||
c &= d;
|
||||
c = false;
|
||||
d &= c;
|
||||
|
||||
var e = true;
|
||||
var f = 0;
|
||||
e |= e;
|
||||
e = true;
|
||||
f |= f;
|
||||
f = 0;
|
||||
e |= f;
|
||||
e = true;
|
||||
f |= f;
|
||||
|
||||
|
||||
|
||||
//// [bitwiseCompoundAssignmentOperators.js]
|
||||
var a = true;
|
||||
var b = 1;
|
||||
a ^= a;
|
||||
a = true;
|
||||
b ^= b;
|
||||
b = 1;
|
||||
a ^= b;
|
||||
a = true;
|
||||
b ^= a;
|
||||
b = 1;
|
||||
var c = false;
|
||||
var d = 2;
|
||||
c &= c;
|
||||
c = false;
|
||||
d &= d;
|
||||
d = 2;
|
||||
c &= d;
|
||||
c = false;
|
||||
d &= c;
|
||||
var e = true;
|
||||
var f = 0;
|
||||
e |= e;
|
||||
e = true;
|
||||
f |= f;
|
||||
f = 0;
|
||||
e |= f;
|
||||
e = true;
|
||||
f |= f;
|
||||
@@ -1,13 +1,16 @@
|
||||
tests/cases/compiler/callOnInstance.ts(1,18): error TS2300: Duplicate identifier 'D'.
|
||||
tests/cases/compiler/callOnInstance.ts(3,15): error TS2300: Duplicate identifier 'D'.
|
||||
tests/cases/compiler/callOnInstance.ts(7,19): error TS2346: Supplied parameters do not match any signature of call target.
|
||||
tests/cases/compiler/callOnInstance.ts(7,19): error TS2350: Only a void function can be called with the 'new' keyword.
|
||||
tests/cases/compiler/callOnInstance.ts(10,1): error TS2349: Cannot invoke an expression whose type lacks a call signature.
|
||||
|
||||
|
||||
==== tests/cases/compiler/callOnInstance.ts (4 errors) ====
|
||||
declare function D(): string;
|
||||
==== tests/cases/compiler/callOnInstance.ts (5 errors) ====
|
||||
declare function D(): string; // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'D'.
|
||||
|
||||
declare class D { constructor (value: number); } // Duplicate identifier
|
||||
declare class D { constructor (value: number); } // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'D'.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//// [callOnInstance.ts]
|
||||
declare function D(): string;
|
||||
declare function D(): string; // error
|
||||
|
||||
declare class D { constructor (value: number); } // Duplicate identifier
|
||||
declare class D { constructor (value: number); } // error
|
||||
|
||||
var s1: string = D(); // OK
|
||||
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
tests/cases/compiler/callOverloads1.ts(1,7): error TS2300: Duplicate identifier 'Foo'.
|
||||
tests/cases/compiler/callOverloads1.ts(9,10): error TS2300: Duplicate identifier 'Foo'.
|
||||
tests/cases/compiler/callOverloads1.ts(9,10): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
tests/cases/compiler/callOverloads1.ts(17,1): error TS2348: Value of type 'typeof Foo' is not callable. Did you mean to include 'new'?
|
||||
|
||||
|
||||
==== tests/cases/compiler/callOverloads1.ts (3 errors) ====
|
||||
class Foo {
|
||||
==== tests/cases/compiler/callOverloads1.ts (4 errors) ====
|
||||
class Foo { // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'Foo'.
|
||||
bar1() { /*WScript.Echo("bar1");*/ }
|
||||
|
||||
constructor(x: any) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//// [callOverloads1.ts]
|
||||
class Foo {
|
||||
class Foo { // error
|
||||
bar1() { /*WScript.Echo("bar1");*/ }
|
||||
|
||||
constructor(x: any) {
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
tests/cases/compiler/callOverloads2.ts(3,7): error TS2300: Duplicate identifier 'Foo'.
|
||||
tests/cases/compiler/callOverloads2.ts(11,10): error TS2300: Duplicate identifier 'Foo'.
|
||||
tests/cases/compiler/callOverloads2.ts(13,10): error TS2389: Function implementation name must be 'Foo'.
|
||||
tests/cases/compiler/callOverloads2.ts(14,1): error TS2393: Duplicate function implementation.
|
||||
tests/cases/compiler/callOverloads2.ts(13,10): error TS2393: Duplicate function implementation.
|
||||
tests/cases/compiler/callOverloads2.ts(14,10): error TS2393: Duplicate function implementation.
|
||||
tests/cases/compiler/callOverloads2.ts(16,10): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
tests/cases/compiler/callOverloads2.ts(24,1): error TS2348: Value of type 'typeof Foo' is not callable. Did you mean to include 'new'?
|
||||
|
||||
|
||||
==== tests/cases/compiler/callOverloads2.ts (5 errors) ====
|
||||
==== tests/cases/compiler/callOverloads2.ts (7 errors) ====
|
||||
|
||||
|
||||
class Foo {
|
||||
class Foo { // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'Foo'.
|
||||
bar1() { /*WScript.Echo("bar1");*/ }
|
||||
|
||||
constructor(x: any) {
|
||||
@@ -16,15 +20,17 @@ tests/cases/compiler/callOverloads2.ts(24,1): error TS2348: Value of type 'typeo
|
||||
}
|
||||
}
|
||||
|
||||
function Foo();
|
||||
function Foo(); // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'Foo'.
|
||||
|
||||
function F1(s:string) {return s;}
|
||||
function F1(s:string) {return s;} // error
|
||||
~~
|
||||
!!! error TS2389: Function implementation name must be 'Foo'.
|
||||
function F1(a:any) { return a;} // error - duplicate identifier
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
function F1(a:any) { return a;} // error
|
||||
~~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
|
||||
function Goo(s:string); // error - no implementation
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//// [callOverloads2.ts]
|
||||
|
||||
|
||||
class Foo {
|
||||
class Foo { // error
|
||||
bar1() { /*WScript.Echo("bar1");*/ }
|
||||
|
||||
constructor(x: any) {
|
||||
@@ -9,10 +9,10 @@ class Foo {
|
||||
}
|
||||
}
|
||||
|
||||
function Foo();
|
||||
function Foo(); // error
|
||||
|
||||
function F1(s:string) {return s;}
|
||||
function F1(a:any) { return a;} // error - duplicate identifier
|
||||
function F1(s:string) {return s;} // error
|
||||
function F1(a:any) { return a;} // error
|
||||
|
||||
function Goo(s:string); // error - no implementation
|
||||
|
||||
@@ -36,10 +36,10 @@ var Foo = (function () {
|
||||
})();
|
||||
function F1(s) {
|
||||
return s;
|
||||
}
|
||||
} // error
|
||||
function F1(a) {
|
||||
return a;
|
||||
} // error - duplicate identifier
|
||||
} // error
|
||||
var f1 = new Foo("hey");
|
||||
f1.bar1();
|
||||
Foo();
|
||||
|
||||
@@ -1,21 +1,27 @@
|
||||
tests/cases/compiler/callOverloads3.ts(2,10): error TS2300: Duplicate identifier 'Foo'.
|
||||
tests/cases/compiler/callOverloads3.ts(2,16): error TS2304: Cannot find name 'Foo'.
|
||||
tests/cases/compiler/callOverloads3.ts(3,10): error TS2300: Duplicate identifier 'Foo'.
|
||||
tests/cases/compiler/callOverloads3.ts(3,10): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
tests/cases/compiler/callOverloads3.ts(3,24): error TS2304: Cannot find name 'Foo'.
|
||||
tests/cases/compiler/callOverloads3.ts(4,7): error TS2300: Duplicate identifier 'Foo'.
|
||||
tests/cases/compiler/callOverloads3.ts(12,10): error TS2350: Only a void function can be called with the 'new' keyword.
|
||||
|
||||
|
||||
==== tests/cases/compiler/callOverloads3.ts (5 errors) ====
|
||||
==== tests/cases/compiler/callOverloads3.ts (7 errors) ====
|
||||
|
||||
function Foo():Foo;
|
||||
function Foo():Foo; // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'Foo'.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'Foo'.
|
||||
function Foo(s:string):Foo;
|
||||
function Foo(s:string):Foo; // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'Foo'.
|
||||
~~~
|
||||
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'Foo'.
|
||||
class Foo {
|
||||
class Foo { // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'Foo'.
|
||||
bar1() { /*WScript.Echo("bar1");*/ }
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//// [callOverloads3.ts]
|
||||
|
||||
function Foo():Foo;
|
||||
function Foo(s:string):Foo;
|
||||
class Foo {
|
||||
function Foo():Foo; // error
|
||||
function Foo(s:string):Foo; // error
|
||||
class Foo { // error
|
||||
bar1() { /*WScript.Echo("bar1");*/ }
|
||||
constructor(x: any) {
|
||||
// WScript.Echo("Constructor function has executed");
|
||||
|
||||
@@ -1,21 +1,27 @@
|
||||
tests/cases/compiler/callOverloads4.ts(2,10): error TS2300: Duplicate identifier 'Foo'.
|
||||
tests/cases/compiler/callOverloads4.ts(2,16): error TS2304: Cannot find name 'Foo'.
|
||||
tests/cases/compiler/callOverloads4.ts(3,10): error TS2300: Duplicate identifier 'Foo'.
|
||||
tests/cases/compiler/callOverloads4.ts(3,10): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
tests/cases/compiler/callOverloads4.ts(3,24): error TS2304: Cannot find name 'Foo'.
|
||||
tests/cases/compiler/callOverloads4.ts(4,7): error TS2300: Duplicate identifier 'Foo'.
|
||||
tests/cases/compiler/callOverloads4.ts(12,10): error TS2350: Only a void function can be called with the 'new' keyword.
|
||||
|
||||
|
||||
==== tests/cases/compiler/callOverloads4.ts (5 errors) ====
|
||||
==== tests/cases/compiler/callOverloads4.ts (7 errors) ====
|
||||
|
||||
function Foo():Foo;
|
||||
function Foo():Foo; // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'Foo'.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'Foo'.
|
||||
function Foo(s:string):Foo;
|
||||
function Foo(s:string):Foo; // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'Foo'.
|
||||
~~~
|
||||
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'Foo'.
|
||||
class Foo {
|
||||
class Foo { // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'Foo'.
|
||||
bar1() { /*WScript.Echo("bar1");*/ }
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//// [callOverloads4.ts]
|
||||
|
||||
function Foo():Foo;
|
||||
function Foo(s:string):Foo;
|
||||
class Foo {
|
||||
function Foo():Foo; // error
|
||||
function Foo(s:string):Foo; // error
|
||||
class Foo { // error
|
||||
bar1() { /*WScript.Echo("bar1");*/ }
|
||||
constructor(s: string);
|
||||
constructor(x: any) {
|
||||
|
||||
@@ -1,20 +1,26 @@
|
||||
tests/cases/compiler/callOverloads5.ts(1,10): error TS2300: Duplicate identifier 'Foo'.
|
||||
tests/cases/compiler/callOverloads5.ts(1,16): error TS2304: Cannot find name 'Foo'.
|
||||
tests/cases/compiler/callOverloads5.ts(2,10): error TS2300: Duplicate identifier 'Foo'.
|
||||
tests/cases/compiler/callOverloads5.ts(2,10): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
tests/cases/compiler/callOverloads5.ts(2,24): error TS2304: Cannot find name 'Foo'.
|
||||
tests/cases/compiler/callOverloads5.ts(3,7): error TS2300: Duplicate identifier 'Foo'.
|
||||
tests/cases/compiler/callOverloads5.ts(13,10): error TS2350: Only a void function can be called with the 'new' keyword.
|
||||
|
||||
|
||||
==== tests/cases/compiler/callOverloads5.ts (5 errors) ====
|
||||
function Foo():Foo;
|
||||
==== tests/cases/compiler/callOverloads5.ts (7 errors) ====
|
||||
function Foo():Foo; // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'Foo'.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'Foo'.
|
||||
function Foo(s:string):Foo;
|
||||
function Foo(s:string):Foo; // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'Foo'.
|
||||
~~~
|
||||
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'Foo'.
|
||||
class Foo {
|
||||
class Foo { // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'Foo'.
|
||||
bar1(s:string);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//// [callOverloads5.ts]
|
||||
function Foo():Foo;
|
||||
function Foo(s:string):Foo;
|
||||
class Foo {
|
||||
function Foo():Foo; // error
|
||||
function Foo(s:string):Foo; // error
|
||||
class Foo { // error
|
||||
bar1(s:string);
|
||||
bar1(n:number);
|
||||
bar1(a:any) { /*WScript.Echo(a);*/ }
|
||||
|
||||
@@ -1,107 +1,173 @@
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(3,14): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(3,17): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(4,22): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(4,25): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(5,20): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(5,23): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(6,11): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(6,14): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(7,14): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(7,20): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(9,15): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(9,26): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(10,23): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(10,34): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(11,20): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(11,31): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(12,11): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(12,22): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(16,9): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(16,12): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(17,10): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(17,21): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(18,13): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(18,19): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(22,6): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(22,9): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(23,6): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(23,17): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(24,9): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(24,12): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(25,9): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(25,20): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(26,13): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(26,19): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(30,9): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(30,12): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(31,10): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(31,21): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(35,9): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(35,12): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(36,21): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(36,32): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(37,12): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts(37,18): error TS2300: Duplicate identifier 'x'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts (22 errors) ====
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithDuplicateParameters.ts (44 errors) ====
|
||||
// Duplicate parameter names are always an error
|
||||
|
||||
function foo(x, x) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
var f = function foo(x, x) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
var f2 = function (x, x) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
var f3 = (x, x) => { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
var f4 = <T>(x: T, x: T) => { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
|
||||
function foo2(x: string, x: number) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
var f5 = function foo(x: string, x: number) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
var f6 = function (x: string, x: number) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
var f7 = (x: string, x: number) => { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
var f8 = <T>(x: T, y: T) => { }
|
||||
|
||||
class C {
|
||||
foo(x, x) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
foo2(x: number, x: string) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
foo3<T>(x: T, x: T) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
}
|
||||
|
||||
interface I {
|
||||
(x, x);
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
(x: string, x: number);
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
foo(x, x);
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
foo(x: number, x: string);
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
foo3<T>(x: T, x: T);
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
}
|
||||
|
||||
var a: {
|
||||
foo(x, x);
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
foo2(x: number, x: string);
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
};
|
||||
|
||||
var b = {
|
||||
foo(x, x) { },
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
a: function foo(x: number, x: string) { },
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
b: <T>(x: T, x: T) => { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(20,15): error TS1005: '{' expected.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(4,14): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(11,9): error TS2371: A parameter initializer is only allowed in a function or constructor implementation.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(20,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts(21,5): error TS2300: Duplicate identifier 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts (4 errors) ====
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWithParameterInitializers2.ts (5 errors) ====
|
||||
// Optional parameters allow initializers only in implementation signatures
|
||||
// All the below declarations are errors
|
||||
|
||||
@@ -28,10 +29,12 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/callSignaturesWit
|
||||
c.foo(1);
|
||||
|
||||
var b = {
|
||||
foo(x = 1),
|
||||
foo(x = 1), // error
|
||||
~
|
||||
!!! error TS1005: '{' expected.
|
||||
foo(x = 1) { },
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
foo(x = 1) { }, // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
tests/cases/conformance/types/tuple/castingTuple.ts(24,10): error TS2353: Neither type '[number, string]' nor type '[number, number]' is assignable to the other:
|
||||
Types of property '1' are incompatible:
|
||||
Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/conformance/types/tuple/castingTuple.ts(25,10): error TS2353: Neither type '[C, D]' nor type '[A, I]' is assignable to the other:
|
||||
Types of property '0' are incompatible:
|
||||
Type 'C' is not assignable to type 'A':
|
||||
Property 'a' is missing in type 'C'.
|
||||
tests/cases/conformance/types/tuple/castingTuple.ts(26,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' must be of type '{}[]', but here has type 'number[]'.
|
||||
tests/cases/conformance/types/tuple/castingTuple.ts(26,14): error TS2353: Neither type '[number, string]' nor type 'number[]' is assignable to the other:
|
||||
Types of property 'pop' are incompatible:
|
||||
Type '() => {}' is not assignable to type '() => number':
|
||||
Type '{}' is not assignable to type 'number'.
|
||||
tests/cases/conformance/types/tuple/castingTuple.ts(27,1): error TS2304: Cannot find name 't4'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/tuple/castingTuple.ts (5 errors) ====
|
||||
interface I { }
|
||||
class A { a = 10; }
|
||||
class C implements I { c };
|
||||
class D implements I { d };
|
||||
class E extends A { e };
|
||||
class F extends A { f };
|
||||
enum E1 { one }
|
||||
enum E2 { one }
|
||||
|
||||
// no error
|
||||
var numStrTuple: [number, string] = [5, "foo"];
|
||||
var emptyObjTuple = <[{}, {}]>numStrTuple;
|
||||
var numStrBoolTuple = <[number, string, boolean]>numStrTuple;
|
||||
var classCDTuple: [C, D] = [new C(), new D()];
|
||||
var interfaceIITuple = <[I, I]>classCDTuple;
|
||||
var classCDATuple = <[C, D, A]>classCDTuple;
|
||||
var eleFromCDA1 = classCDATuple[2]; // A
|
||||
var eleFromCDA2 = classCDATuple[5]; // {}
|
||||
var t10: [E1, E2] = [E1.one, E2.one];
|
||||
var t11 = <[number, number]>t10;
|
||||
var array1 = <{}[]>emptyObjTuple;
|
||||
|
||||
// error
|
||||
var t3 = <[number, number]>numStrTuple;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2353: Neither type '[number, string]' nor type '[number, number]' is assignable to the other:
|
||||
!!! error TS2353: Types of property '1' are incompatible:
|
||||
!!! error TS2353: Type 'string' is not assignable to type 'number'.
|
||||
var t9 = <[A, I]>classCDTuple;
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2353: Neither type '[C, D]' nor type '[A, I]' is assignable to the other:
|
||||
!!! error TS2353: Types of property '0' are incompatible:
|
||||
!!! error TS2353: Type 'C' is not assignable to type 'A':
|
||||
!!! error TS2353: Property 'a' is missing in type 'C'.
|
||||
var array1 = <number[]>numStrTuple;
|
||||
~~~~~~
|
||||
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' must be of type '{}[]', but here has type 'number[]'.
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2353: Neither type '[number, string]' nor type 'number[]' is assignable to the other:
|
||||
!!! error TS2353: Types of property 'pop' are incompatible:
|
||||
!!! error TS2353: Type '() => {}' is not assignable to type '() => number':
|
||||
!!! error TS2353: Type '{}' is not assignable to type 'number'.
|
||||
t4[2] = 10;
|
||||
~~
|
||||
!!! error TS2304: Cannot find name 't4'.
|
||||
@@ -0,0 +1,95 @@
|
||||
//// [castingTuple.ts]
|
||||
interface I { }
|
||||
class A { a = 10; }
|
||||
class C implements I { c };
|
||||
class D implements I { d };
|
||||
class E extends A { e };
|
||||
class F extends A { f };
|
||||
enum E1 { one }
|
||||
enum E2 { one }
|
||||
|
||||
// no error
|
||||
var numStrTuple: [number, string] = [5, "foo"];
|
||||
var emptyObjTuple = <[{}, {}]>numStrTuple;
|
||||
var numStrBoolTuple = <[number, string, boolean]>numStrTuple;
|
||||
var classCDTuple: [C, D] = [new C(), new D()];
|
||||
var interfaceIITuple = <[I, I]>classCDTuple;
|
||||
var classCDATuple = <[C, D, A]>classCDTuple;
|
||||
var eleFromCDA1 = classCDATuple[2]; // A
|
||||
var eleFromCDA2 = classCDATuple[5]; // {}
|
||||
var t10: [E1, E2] = [E1.one, E2.one];
|
||||
var t11 = <[number, number]>t10;
|
||||
var array1 = <{}[]>emptyObjTuple;
|
||||
|
||||
// error
|
||||
var t3 = <[number, number]>numStrTuple;
|
||||
var t9 = <[A, I]>classCDTuple;
|
||||
var array1 = <number[]>numStrTuple;
|
||||
t4[2] = 10;
|
||||
|
||||
//// [castingTuple.js]
|
||||
var __extends = this.__extends || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
__.prototype = b.prototype;
|
||||
d.prototype = new __();
|
||||
};
|
||||
var A = (function () {
|
||||
function A() {
|
||||
this.a = 10;
|
||||
}
|
||||
return A;
|
||||
})();
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
return C;
|
||||
})();
|
||||
;
|
||||
var D = (function () {
|
||||
function D() {
|
||||
}
|
||||
return D;
|
||||
})();
|
||||
;
|
||||
var E = (function (_super) {
|
||||
__extends(E, _super);
|
||||
function E() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return E;
|
||||
})(A);
|
||||
;
|
||||
var F = (function (_super) {
|
||||
__extends(F, _super);
|
||||
function F() {
|
||||
_super.apply(this, arguments);
|
||||
}
|
||||
return F;
|
||||
})(A);
|
||||
;
|
||||
var E1;
|
||||
(function (E1) {
|
||||
E1[E1["one"] = 0] = "one";
|
||||
})(E1 || (E1 = {}));
|
||||
var E2;
|
||||
(function (E2) {
|
||||
E2[E2["one"] = 0] = "one";
|
||||
})(E2 || (E2 = {}));
|
||||
// no error
|
||||
var numStrTuple = [5, "foo"];
|
||||
var emptyObjTuple = numStrTuple;
|
||||
var numStrBoolTuple = numStrTuple;
|
||||
var classCDTuple = [new C(), new D()];
|
||||
var interfaceIITuple = classCDTuple;
|
||||
var classCDATuple = classCDTuple;
|
||||
var eleFromCDA1 = classCDATuple[2]; // A
|
||||
var eleFromCDA2 = classCDATuple[5]; // {}
|
||||
var t10 = [0 /* one */, 0 /* one */];
|
||||
var t11 = t10;
|
||||
var array1 = emptyObjTuple;
|
||||
// error
|
||||
var t3 = numStrTuple;
|
||||
var t9 = classCDTuple;
|
||||
var array1 = numStrTuple;
|
||||
t4[2] = 10;
|
||||
@@ -1,8 +1,11 @@
|
||||
tests/cases/compiler/class1.ts(1,11): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/compiler/class1.ts(2,7): error TS2300: Duplicate identifier 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/class1.ts (1 errors) ====
|
||||
interface foo{ }
|
||||
class foo{ }
|
||||
==== tests/cases/compiler/class1.ts (2 errors) ====
|
||||
interface foo{ } // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
class foo{ } // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
@@ -1,10 +1,10 @@
|
||||
//// [class1.ts]
|
||||
interface foo{ }
|
||||
class foo{ }
|
||||
interface foo{ } // error
|
||||
class foo{ } // error
|
||||
|
||||
//// [class1.js]
|
||||
var foo = (function () {
|
||||
function foo() {
|
||||
}
|
||||
return foo;
|
||||
})();
|
||||
})(); // error
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
tests/cases/compiler/classAndInterface1.ts(1,8): error TS2300: Duplicate identifier 'cli'.
|
||||
tests/cases/compiler/classAndInterface1.ts(2,11): error TS2300: Duplicate identifier 'cli'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classAndInterface1.ts (1 errors) ====
|
||||
class cli { }
|
||||
==== tests/cases/compiler/classAndInterface1.ts (2 errors) ====
|
||||
class cli { } // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'cli'.
|
||||
interface cli { } // error
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'cli'.
|
||||
@@ -1,5 +1,5 @@
|
||||
//// [classAndInterface1.ts]
|
||||
class cli { }
|
||||
class cli { } // error
|
||||
interface cli { } // error
|
||||
|
||||
//// [classAndInterface1.js]
|
||||
@@ -7,4 +7,4 @@ var cli = (function () {
|
||||
function cli() {
|
||||
}
|
||||
return cli;
|
||||
})();
|
||||
})(); // error
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts(1,7): error TS2300: Duplicate identifier 'C'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts(2,11): error TS2300: Duplicate identifier 'C'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts(5,11): error TS2300: Duplicate identifier 'D'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts(9,15): error TS2300: Duplicate identifier 'D'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts (2 errors) ====
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAndInterfaceWithSameName.ts (4 errors) ====
|
||||
class C { foo: string; }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'C'.
|
||||
interface C { foo: string; } // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'C'.
|
||||
|
||||
module M {
|
||||
class D {
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'D'.
|
||||
bar: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classAndVariableWithSameName.ts(1,7): error TS2300: Duplicate identifier 'C'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAndVariableWithSameName.ts(2,5): error TS2300: Duplicate identifier 'C'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAndVariableWithSameName.ts(5,11): error TS2300: Duplicate identifier 'D'.
|
||||
tests/cases/conformance/classes/classDeclarations/classAndVariableWithSameName.ts(9,9): error TS2300: Duplicate identifier 'D'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAndVariableWithSameName.ts (2 errors) ====
|
||||
class C { foo: string; }
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAndVariableWithSameName.ts (4 errors) ====
|
||||
class C { foo: string; } // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'C'.
|
||||
var C = ''; // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'C'.
|
||||
|
||||
module M {
|
||||
class D {
|
||||
class D { // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'D'.
|
||||
bar: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
//// [classAndVariableWithSameName.ts]
|
||||
class C { foo: string; }
|
||||
class C { foo: string; } // error
|
||||
var C = ''; // error
|
||||
|
||||
module M {
|
||||
class D {
|
||||
class D { // error
|
||||
bar: string;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
return C;
|
||||
})();
|
||||
})(); // error
|
||||
var C = ''; // error
|
||||
var M;
|
||||
(function (M) {
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
tests/cases/compiler/classCannotExtendVar.ts(1,5): error TS2300: Duplicate identifier 'Markup'.
|
||||
tests/cases/compiler/classCannotExtendVar.ts(3,7): error TS2300: Duplicate identifier 'Markup'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classCannotExtendVar.ts (1 errors) ====
|
||||
==== tests/cases/compiler/classCannotExtendVar.ts (2 errors) ====
|
||||
var Markup;
|
||||
~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'Markup'.
|
||||
|
||||
class Markup {
|
||||
~~~~~~
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
tests/cases/compiler/classOverloadForFunction.ts(1,7): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/compiler/classOverloadForFunction.ts(2,10): error TS2300: Duplicate identifier 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classOverloadForFunction.ts (1 errors) ====
|
||||
==== tests/cases/compiler/classOverloadForFunction.ts (2 errors) ====
|
||||
class foo { };
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
function foo() {}
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
tests/cases/compiler/classOverloadForFunction2.ts(1,10): error TS2300: Duplicate identifier 'bar'.
|
||||
tests/cases/compiler/classOverloadForFunction2.ts(1,10): error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
tests/cases/compiler/classOverloadForFunction2.ts(2,7): error TS2300: Duplicate identifier 'bar'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classOverloadForFunction2.ts (2 errors) ====
|
||||
==== tests/cases/compiler/classOverloadForFunction2.ts (3 errors) ====
|
||||
function bar(): string;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'bar'.
|
||||
~~~
|
||||
!!! error TS2391: Function implementation is missing or not immediately following the declaration.
|
||||
class bar {}
|
||||
~~~
|
||||
|
||||
@@ -1,17 +1,23 @@
|
||||
tests/cases/conformance/classes/constructorDeclarations/classWithTwoConstructorDefinitions.ts(2,5): error TS2392: Multiple constructor implementations are not allowed.
|
||||
tests/cases/conformance/classes/constructorDeclarations/classWithTwoConstructorDefinitions.ts(3,5): error TS2392: Multiple constructor implementations are not allowed.
|
||||
tests/cases/conformance/classes/constructorDeclarations/classWithTwoConstructorDefinitions.ts(7,5): error TS2392: Multiple constructor implementations are not allowed.
|
||||
tests/cases/conformance/classes/constructorDeclarations/classWithTwoConstructorDefinitions.ts(8,5): error TS2392: Multiple constructor implementations are not allowed.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/constructorDeclarations/classWithTwoConstructorDefinitions.ts (2 errors) ====
|
||||
==== tests/cases/conformance/classes/constructorDeclarations/classWithTwoConstructorDefinitions.ts (4 errors) ====
|
||||
class C {
|
||||
constructor() { }
|
||||
constructor() { } // error
|
||||
~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2392: Multiple constructor implementations are not allowed.
|
||||
constructor(x) { } // error
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2392: Multiple constructor implementations are not allowed.
|
||||
}
|
||||
|
||||
class D<T> {
|
||||
constructor(x: T) { }
|
||||
constructor(x: T) { } // error
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2392: Multiple constructor implementations are not allowed.
|
||||
constructor(x: T, y: T) { } // error
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2392: Multiple constructor implementations are not allowed.
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
//// [classWithTwoConstructorDefinitions.ts]
|
||||
class C {
|
||||
constructor() { }
|
||||
constructor() { } // error
|
||||
constructor(x) { } // error
|
||||
}
|
||||
|
||||
class D<T> {
|
||||
constructor(x: T) { }
|
||||
constructor(x: T) { } // error
|
||||
constructor(x: T, y: T) { } // error
|
||||
}
|
||||
|
||||
//// [classWithTwoConstructorDefinitions.js]
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
} // error
|
||||
return C;
|
||||
})();
|
||||
var D = (function () {
|
||||
function D(x) {
|
||||
}
|
||||
} // error
|
||||
return D;
|
||||
})();
|
||||
|
||||
@@ -1,22 +1,32 @@
|
||||
tests/cases/compiler/clinterfaces.ts(2,11): error TS2300: Duplicate identifier 'C'.
|
||||
tests/cases/compiler/clinterfaces.ts(3,15): error TS2300: Duplicate identifier 'C'.
|
||||
tests/cases/compiler/clinterfaces.ts(4,15): error TS2300: Duplicate identifier 'D'.
|
||||
tests/cases/compiler/clinterfaces.ts(5,11): error TS2300: Duplicate identifier 'D'.
|
||||
tests/cases/compiler/clinterfaces.ts(8,11): error TS2300: Duplicate identifier 'Foo'.
|
||||
tests/cases/compiler/clinterfaces.ts(12,7): error TS2300: Duplicate identifier 'Foo'.
|
||||
tests/cases/compiler/clinterfaces.ts(16,7): error TS2300: Duplicate identifier 'Bar'.
|
||||
tests/cases/compiler/clinterfaces.ts(20,11): error TS2300: Duplicate identifier 'Bar'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/clinterfaces.ts (4 errors) ====
|
||||
==== tests/cases/compiler/clinterfaces.ts (8 errors) ====
|
||||
module M {
|
||||
class C { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'C'.
|
||||
interface C { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'C'.
|
||||
interface D { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'D'.
|
||||
class D { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'D'.
|
||||
}
|
||||
|
||||
interface Foo<T> {
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'Foo'.
|
||||
a: string;
|
||||
}
|
||||
|
||||
@@ -27,6 +37,8 @@ tests/cases/compiler/clinterfaces.ts(20,11): error TS2300: Duplicate identifier
|
||||
}
|
||||
|
||||
class Bar<T>{
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'Bar'.
|
||||
b: number;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
tests/cases/compiler/cloduleWithDuplicateMember1.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/cloduleWithDuplicateMember1.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/cloduleWithDuplicateMember1.ts(3,16): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/compiler/cloduleWithDuplicateMember1.ts(6,12): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/compiler/cloduleWithDuplicateMember1.ts(10,16): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/compiler/cloduleWithDuplicateMember1.ts(13,21): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/compiler/cloduleWithDuplicateMember1.ts(14,21): error TS2300: Duplicate identifier 'x'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/cloduleWithDuplicateMember1.ts (5 errors) ====
|
||||
==== tests/cases/compiler/cloduleWithDuplicateMember1.ts (7 errors) ====
|
||||
class C {
|
||||
get x() { return 1; }
|
||||
~
|
||||
@@ -13,9 +15,13 @@ tests/cases/compiler/cloduleWithDuplicateMember1.ts(14,21): error TS2300: Duplic
|
||||
static get x() {
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
return '';
|
||||
}
|
||||
static foo() { }
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
}
|
||||
|
||||
module C {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
tests/cases/compiler/cloduleWithDuplicateMember2.ts(2,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/cloduleWithDuplicateMember2.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/cloduleWithDuplicateMember2.ts(7,16): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/compiler/cloduleWithDuplicateMember2.ts(10,21): error TS2300: Duplicate identifier 'x'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/cloduleWithDuplicateMember2.ts (3 errors) ====
|
||||
==== tests/cases/compiler/cloduleWithDuplicateMember2.ts (4 errors) ====
|
||||
class C {
|
||||
set x(y) { }
|
||||
~
|
||||
@@ -15,6 +16,8 @@ tests/cases/compiler/cloduleWithDuplicateMember2.ts(10,21): error TS2300: Duplic
|
||||
|
||||
module C {
|
||||
export var x = 1;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
}
|
||||
module C {
|
||||
export function x() { }
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
tests/cases/compiler/conflictingTypeAnnotatedVar.ts(1,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/compiler/conflictingTypeAnnotatedVar.ts(2,10): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/compiler/conflictingTypeAnnotatedVar.ts(2,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
tests/cases/compiler/conflictingTypeAnnotatedVar.ts(3,10): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/compiler/conflictingTypeAnnotatedVar.ts(3,17): error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value or consist of a single 'throw' statement.
|
||||
|
||||
|
||||
==== tests/cases/compiler/conflictingTypeAnnotatedVar.ts (4 errors) ====
|
||||
==== tests/cases/compiler/conflictingTypeAnnotatedVar.ts (5 errors) ====
|
||||
var foo: string;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
function foo(): number { }
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
|
||||
+10
-1
@@ -1,8 +1,11 @@
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(4,17): error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(4,24): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(4,27): error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(4,35): error TS2300: Duplicate identifier 'y'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(5,24): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(5,35): error TS2300: Duplicate identifier 'y'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(9,17): error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(9,25): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(10,24): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(14,17): error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(19,10): error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
@@ -15,15 +18,19 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatur
|
||||
tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts(35,10): error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts (15 errors) ====
|
||||
==== tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatureWithAccessibilityModifiersOnParameters2.ts (18 errors) ====
|
||||
// Parameter properties are not valid in overloads of constructors
|
||||
|
||||
class C {
|
||||
constructor(public x, private y);
|
||||
~~~~~~~~
|
||||
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
~~~~~~~~~
|
||||
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'y'.
|
||||
constructor(public x, private y) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
@@ -35,6 +42,8 @@ tests/cases/conformance/types/objectTypeLiteral/callSignatures/constructSignatur
|
||||
constructor(private x);
|
||||
~~~~~~~~~
|
||||
!!! error TS2369: A parameter property is only allowed in a constructor implementation.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
constructor(public x) { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
|
||||
@@ -1,15 +1,26 @@
|
||||
tests/cases/compiler/constructorOverloads1.ts(2,5): error TS2392: Multiple constructor implementations are not allowed.
|
||||
tests/cases/compiler/constructorOverloads1.ts(3,5): error TS2392: Multiple constructor implementations are not allowed.
|
||||
tests/cases/compiler/constructorOverloads1.ts(4,5): error TS2392: Multiple constructor implementations are not allowed.
|
||||
tests/cases/compiler/constructorOverloads1.ts(7,5): error TS2392: Multiple constructor implementations are not allowed.
|
||||
tests/cases/compiler/constructorOverloads1.ts(16,18): error TS2345: Argument of type 'Foo' is not assignable to parameter of type 'number'.
|
||||
tests/cases/compiler/constructorOverloads1.ts(17,18): error TS2345: Argument of type 'unknown[]' is not assignable to parameter of type 'number'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/constructorOverloads1.ts (3 errors) ====
|
||||
==== tests/cases/compiler/constructorOverloads1.ts (6 errors) ====
|
||||
class Foo {
|
||||
constructor(s: string);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2392: Multiple constructor implementations are not allowed.
|
||||
constructor(n: number);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2392: Multiple constructor implementations are not allowed.
|
||||
constructor(x: any) {
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
}
|
||||
~~~~~
|
||||
!!! error TS2392: Multiple constructor implementations are not allowed.
|
||||
constructor(x: any) {
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
tests/cases/compiler/constructorOverloads4.ts(2,18): error TS2300: Duplicate identifier 'Function'.
|
||||
tests/cases/compiler/constructorOverloads4.ts(5,21): error TS2300: Duplicate identifier 'Function'.
|
||||
tests/cases/compiler/constructorOverloads4.ts(6,21): error TS2300: Duplicate identifier 'Function'.
|
||||
tests/cases/compiler/constructorOverloads4.ts(10,1): error TS2349: Cannot invoke an expression whose type lacks a call signature.
|
||||
tests/cases/compiler/constructorOverloads4.ts(11,1): error TS2348: Value of type 'typeof Function' is not callable. Did you mean to include 'new'?
|
||||
|
||||
|
||||
==== tests/cases/compiler/constructorOverloads4.ts (4 errors) ====
|
||||
==== tests/cases/compiler/constructorOverloads4.ts (5 errors) ====
|
||||
declare module M {
|
||||
export class Function {
|
||||
~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'Function'.
|
||||
constructor(...args: string[]);
|
||||
}
|
||||
export function Function(...args: any[]): any;
|
||||
|
||||
@@ -1,12 +1,18 @@
|
||||
tests/cases/compiler/constructorOverloads5.ts(4,21): error TS2300: Duplicate identifier 'RegExp'.
|
||||
tests/cases/compiler/constructorOverloads5.ts(5,21): error TS2300: Duplicate identifier 'RegExp'.
|
||||
tests/cases/compiler/constructorOverloads5.ts(6,18): error TS2300: Duplicate identifier 'RegExp'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/constructorOverloads5.ts (1 errors) ====
|
||||
==== tests/cases/compiler/constructorOverloads5.ts (3 errors) ====
|
||||
interface IArguments {}
|
||||
|
||||
declare module M {
|
||||
export function RegExp(pattern: string): RegExp;
|
||||
~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'RegExp'.
|
||||
export function RegExp(pattern: string, flags: string): RegExp;
|
||||
~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'RegExp'.
|
||||
export class RegExp {
|
||||
~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'RegExp'.
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
tests/cases/compiler/constructorOverloads7.ts(1,15): error TS2300: Duplicate identifier 'Point'.
|
||||
tests/cases/compiler/constructorOverloads7.ts(15,10): error TS2300: Duplicate identifier 'Point'.
|
||||
tests/cases/compiler/constructorOverloads7.ts(22,18): error TS2384: Overload signatures must all be ambient or non-ambient.
|
||||
|
||||
|
||||
==== tests/cases/compiler/constructorOverloads7.ts (2 errors) ====
|
||||
==== tests/cases/compiler/constructorOverloads7.ts (3 errors) ====
|
||||
declare class Point
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'Point'.
|
||||
{
|
||||
x: number;
|
||||
y: number;
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
tests/cases/compiler/constructorOverloads8.ts(2,5): error TS2392: Multiple constructor implementations are not allowed.
|
||||
tests/cases/compiler/constructorOverloads8.ts(3,5): error TS2392: Multiple constructor implementations are not allowed.
|
||||
|
||||
|
||||
==== tests/cases/compiler/constructorOverloads8.ts (1 errors) ====
|
||||
==== tests/cases/compiler/constructorOverloads8.ts (2 errors) ====
|
||||
class C {
|
||||
constructor(x) { }
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2392: Multiple constructor implementations are not allowed.
|
||||
constructor(y, x) { } // illegal, 2 constructor implementations
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2392: Multiple constructor implementations are not allowed.
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(10,5): error TS2300: Duplicate identifier 'y'.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(11,24): error TS2300: Duplicate identifier 'y'.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(18,5): error TS2300: Duplicate identifier 'y'.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(19,25): error TS2300: Duplicate identifier 'y'.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(26,5): error TS2300: Duplicate identifier 'y'.
|
||||
tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts(27,27): error TS2300: Duplicate identifier 'y'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts (3 errors) ====
|
||||
==== tests/cases/conformance/classes/constructorDeclarations/constructorParameters/constructorParameterProperties2.ts (6 errors) ====
|
||||
class C {
|
||||
y: number;
|
||||
constructor(y: number) { } // ok
|
||||
@@ -14,6 +17,8 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co
|
||||
|
||||
class D {
|
||||
y: number;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'y'.
|
||||
constructor(public y: number) { } // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'y'.
|
||||
@@ -24,6 +29,8 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co
|
||||
|
||||
class E {
|
||||
y: number;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'y'.
|
||||
constructor(private y: number) { } // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'y'.
|
||||
@@ -34,6 +41,8 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/co
|
||||
|
||||
class F {
|
||||
y: number;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'y'.
|
||||
constructor(protected y: number) { } // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'y'.
|
||||
|
||||
@@ -72,8 +72,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(89,23): error TS
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(108,24): error TS2365: Operator '+' cannot be applied to types 'number' and 'boolean'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(159,31): error TS2304: Cannot find name 'Property'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(166,13): error TS2365: Operator '+=' cannot be applied to types 'number' and 'void'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(180,40): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(180,47): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(180,40): error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(213,16): error TS2304: Cannot find name 'bool'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(218,29): error TS2304: Cannot find name 'yield'.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(223,23): error TS2304: Cannot find name 'bool'.
|
||||
@@ -96,7 +95,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,29): error T
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error TS2304: Cannot find name 'string'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (96 errors) ====
|
||||
==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (95 errors) ====
|
||||
declare module "fs" {
|
||||
export class File {
|
||||
constructor(filename: string);
|
||||
@@ -370,10 +369,8 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T
|
||||
var i = a[1];/*[]*/
|
||||
i = i + i - i * i / i % i & i | i ^ i;/*+ - * / % & | ^*/
|
||||
var b = true && false || true ^ false;/*& | ^*/
|
||||
~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~
|
||||
!!! error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2447: The '^' operator is not allowed for boolean types. Consider using '!==' instead.
|
||||
b = !b;/*!*/
|
||||
i = ~i;/*~i*/
|
||||
b = i < (i - 1) && (i + 1) > i;/*< && >*/
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(11,1): error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]':
|
||||
Types of property '0' are incompatible:
|
||||
Type '{}' is not assignable to type '{ a: string; }':
|
||||
Property 'a' is missing in type '{}'.
|
||||
tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(12,1): error TS2322: Type '[number, string]' is not assignable to type '[number, string, boolean]':
|
||||
Property '2' is missing in type '[number, string]'.
|
||||
tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(13,5): error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]':
|
||||
Types of property 'pop' are incompatible:
|
||||
Type '() => {}' is not assignable to type '() => string':
|
||||
Type '{}' is not assignable to type 'string'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts (3 errors) ====
|
||||
// no error
|
||||
var numStrTuple: [number, string] = [5, "hello"];
|
||||
var numStrTuple2: [number, string] = [5, "foo", true];
|
||||
var numStrBoolTuple: [number, string, boolean] = [5, "foo", true];
|
||||
var objNumTuple: [{ a: string }, number] = [{ a: "world" }, 5];
|
||||
var strTupleTuple: [string, [number, {}]] = ["bar", [5, { x: 1, y: 1 }]];
|
||||
numStrTuple = numStrTuple2;
|
||||
numStrTuple = numStrBoolTuple;
|
||||
|
||||
// error
|
||||
objNumTuple = [ {}, 5];
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2322: Type '[{}, number]' is not assignable to type '[{ a: string; }, number]':
|
||||
!!! error TS2322: Types of property '0' are incompatible:
|
||||
!!! error TS2322: Type '{}' is not assignable to type '{ a: string; }':
|
||||
!!! error TS2322: Property 'a' is missing in type '{}'.
|
||||
numStrBoolTuple = numStrTuple;
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2322: Type '[number, string]' is not assignable to type '[number, string, boolean]':
|
||||
!!! error TS2322: Property '2' is missing in type '[number, string]'.
|
||||
var strStrTuple: [string, string] = ["foo", "bar", 5];
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2322: Type '[string, string, number]' is not assignable to type '[string, string]':
|
||||
!!! error TS2322: Types of property 'pop' are incompatible:
|
||||
!!! error TS2322: Type '() => {}' is not assignable to type '() => string':
|
||||
!!! error TS2322: Type '{}' is not assignable to type 'string'.
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
//// [contextualTypeWithTuple.ts]
|
||||
// no error
|
||||
var numStrTuple: [number, string] = [5, "hello"];
|
||||
var numStrTuple2: [number, string] = [5, "foo", true];
|
||||
var numStrBoolTuple: [number, string, boolean] = [5, "foo", true];
|
||||
var objNumTuple: [{ a: string }, number] = [{ a: "world" }, 5];
|
||||
var strTupleTuple: [string, [number, {}]] = ["bar", [5, { x: 1, y: 1 }]];
|
||||
numStrTuple = numStrTuple2;
|
||||
numStrTuple = numStrBoolTuple;
|
||||
|
||||
// error
|
||||
objNumTuple = [ {}, 5];
|
||||
numStrBoolTuple = numStrTuple;
|
||||
var strStrTuple: [string, string] = ["foo", "bar", 5];
|
||||
|
||||
|
||||
//// [contextualTypeWithTuple.js]
|
||||
// no error
|
||||
var numStrTuple = [5, "hello"];
|
||||
var numStrTuple2 = [5, "foo", true];
|
||||
var numStrBoolTuple = [5, "foo", true];
|
||||
var objNumTuple = [{ a: "world" }, 5];
|
||||
var strTupleTuple = ["bar", [5, { x: 1, y: 1 }]];
|
||||
numStrTuple = numStrTuple2;
|
||||
numStrTuple = numStrBoolTuple;
|
||||
// error
|
||||
objNumTuple = [{}, 5];
|
||||
numStrBoolTuple = numStrTuple;
|
||||
var strStrTuple = ["foo", "bar", 5];
|
||||
@@ -1,9 +1,10 @@
|
||||
tests/cases/compiler/contextualTyping.ts(189,18): error TS2384: Overload signatures must all be ambient or non-ambient.
|
||||
tests/cases/compiler/contextualTyping.ts(197,15): error TS2300: Duplicate identifier 'Point'.
|
||||
tests/cases/compiler/contextualTyping.ts(207,10): error TS2300: Duplicate identifier 'Point'.
|
||||
tests/cases/compiler/contextualTyping.ts(230,5): error TS2322: Type '{}' is not assignable to type 'B':\n Property 'x' is missing in type '{}'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/contextualTyping.ts (3 errors) ====
|
||||
==== tests/cases/compiler/contextualTyping.ts (4 errors) ====
|
||||
// DEFAULT INTERFACES
|
||||
interface IFoo {
|
||||
n: number;
|
||||
@@ -203,6 +204,8 @@ tests/cases/compiler/contextualTyping.ts(230,5): error TS2322: Type '{}' is not
|
||||
|
||||
// contextually typing from ambient class declarations
|
||||
declare class Point
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'Point'.
|
||||
{
|
||||
constructor(x: number, y: number);
|
||||
x: number;
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
tests/cases/compiler/declInput.ts(1,11): error TS2300: Duplicate identifier 'bar'.
|
||||
tests/cases/compiler/declInput.ts(5,7): error TS2300: Duplicate identifier 'bar'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/declInput.ts (1 errors) ====
|
||||
==== tests/cases/compiler/declInput.ts (2 errors) ====
|
||||
interface bar {
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'bar'.
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,12 @@ tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompa
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(11,5): error TS2412: Property ''1'' of type '{ y: number; }' is not assignable to numeric index type '{ x: number; y: number; }'.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(15,5): error TS2411: Property 'foo' of type '{ y: number; }' is not assignable to string index type '{ x: number; }'.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(19,5): error TS2411: Property 'foo' of type '() => { x: number; }' is not assignable to string index type '{ x: number; }'.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(24,5): error TS2300: Duplicate identifier '1'.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(24,5): error TS2412: Property '1' of type '{ x: number; }' is not assignable to numeric index type '{ x: number; y: number; }'.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts(28,5): error TS2300: Duplicate identifier ''1''.
|
||||
|
||||
|
||||
==== tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts (8 errors) ====
|
||||
==== tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompatibleWithBaseIndexer.ts (9 errors) ====
|
||||
interface Base {
|
||||
[x: number]: { x: number; y: number; };
|
||||
[x: string]: { x: number; }
|
||||
@@ -45,6 +46,8 @@ tests/cases/conformance/interfaces/interfaceDeclarations/derivedInterfaceIncompa
|
||||
// satisifies string indexer but not numeric indexer
|
||||
interface Derived5 extends Base {
|
||||
1: { x: number } // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2412: Property '1' of type '{ x: number; }' is not assignable to numeric index type '{ x: number; y: number; }'.
|
||||
}
|
||||
|
||||
@@ -8,30 +8,43 @@ tests/cases/compiler/duplicateClassElements.ts(29,9): error TS1056: Accessors ar
|
||||
tests/cases/compiler/duplicateClassElements.ts(32,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/duplicateClassElements.ts(36,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/duplicateClassElements.ts(39,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/duplicateClassElements.ts(2,12): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateClassElements.ts(3,12): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateClassElements.ts(6,5): error TS2393: Duplicate function implementation.
|
||||
tests/cases/compiler/duplicateClassElements.ts(4,12): error TS2393: Duplicate function implementation.
|
||||
tests/cases/compiler/duplicateClassElements.ts(6,12): error TS2393: Duplicate function implementation.
|
||||
tests/cases/compiler/duplicateClassElements.ts(8,12): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/compiler/duplicateClassElements.ts(9,9): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/compiler/duplicateClassElements.ts(12,9): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/compiler/duplicateClassElements.ts(21,12): error TS2300: Duplicate identifier 'z'.
|
||||
tests/cases/compiler/duplicateClassElements.ts(23,9): error TS2300: Duplicate identifier 'z'.
|
||||
tests/cases/compiler/duplicateClassElements.ts(26,9): error TS2300: Duplicate identifier 'z'.
|
||||
tests/cases/compiler/duplicateClassElements.ts(29,9): error TS2300: Duplicate identifier 'x2'.
|
||||
tests/cases/compiler/duplicateClassElements.ts(32,9): error TS2300: Duplicate identifier 'x2'.
|
||||
tests/cases/compiler/duplicateClassElements.ts(34,12): error TS2300: Duplicate identifier 'x2'.
|
||||
tests/cases/compiler/duplicateClassElements.ts(36,9): error TS2300: Duplicate identifier 'z2'.
|
||||
tests/cases/compiler/duplicateClassElements.ts(39,9): error TS2300: Duplicate identifier 'z2'.
|
||||
tests/cases/compiler/duplicateClassElements.ts(41,12): error TS2300: Duplicate identifier 'z2'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateClassElements.ts (18 errors) ====
|
||||
==== tests/cases/compiler/duplicateClassElements.ts (26 errors) ====
|
||||
class a {
|
||||
public a;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
public a;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
public b() {
|
||||
~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
}
|
||||
public b() {
|
||||
~~~~~~~~~~~~
|
||||
}
|
||||
~~~~~
|
||||
~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
}
|
||||
public x;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
get x() {
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
@@ -57,6 +70,8 @@ tests/cases/compiler/duplicateClassElements.ts(41,12): error TS2300: Duplicate i
|
||||
}
|
||||
|
||||
public z() {
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'z'.
|
||||
}
|
||||
get z() {
|
||||
~
|
||||
@@ -75,11 +90,15 @@ tests/cases/compiler/duplicateClassElements.ts(41,12): error TS2300: Duplicate i
|
||||
get x2() {
|
||||
~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'x2'.
|
||||
return 10;
|
||||
}
|
||||
set x2(_x: number) {
|
||||
~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'x2'.
|
||||
}
|
||||
public x2;
|
||||
~~
|
||||
@@ -88,11 +107,15 @@ tests/cases/compiler/duplicateClassElements.ts(41,12): error TS2300: Duplicate i
|
||||
get z2() {
|
||||
~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'z2'.
|
||||
return "Hello";
|
||||
}
|
||||
set z2(_y: string) {
|
||||
~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier 'z2'.
|
||||
}
|
||||
public z2() {
|
||||
~~
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(1,5): error TS2300: Duplicate identifier 'v'.
|
||||
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(3,14): error TS2300: Duplicate identifier 'v'.
|
||||
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(6,10): error TS2300: Duplicate identifier 'w'.
|
||||
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(8,9): error TS2300: Duplicate identifier 'w'.
|
||||
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(12,9): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(13,14): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(16,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'string', but here has type 'number'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateIdentifierInCatchBlock.ts (4 errors) ====
|
||||
==== tests/cases/compiler/duplicateIdentifierInCatchBlock.ts (7 errors) ====
|
||||
var v;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'v'.
|
||||
try { } catch (e) {
|
||||
function v() { }
|
||||
~
|
||||
@@ -13,6 +18,8 @@ tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(16,9): error TS2403: Sub
|
||||
}
|
||||
|
||||
function w() { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'w'.
|
||||
try { } catch (e) {
|
||||
var w;
|
||||
~
|
||||
@@ -21,6 +28,8 @@ tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(16,9): error TS2403: Sub
|
||||
|
||||
try { } catch (e) {
|
||||
var x;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
function x() { } // error
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
|
||||
@@ -1,11 +1,16 @@
|
||||
tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts(2,22): error TS2300: Duplicate identifier 'I'.
|
||||
tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts(5,18): error TS2300: Duplicate identifier 'I'.
|
||||
tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts(9,21): error TS2300: Duplicate identifier 'f'.
|
||||
tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts(12,18): error TS2300: Duplicate identifier 'f'.
|
||||
tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts(37,12): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts(41,16): error TS2300: Duplicate identifier 'x'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts (3 errors) ====
|
||||
==== tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts (6 errors) ====
|
||||
module M {
|
||||
export interface I { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'I'.
|
||||
}
|
||||
module M {
|
||||
export class I { } // error
|
||||
@@ -15,6 +20,8 @@ tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts(41,16): er
|
||||
|
||||
module M {
|
||||
export function f() { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'f'.
|
||||
}
|
||||
module M {
|
||||
export class f { } // error
|
||||
@@ -45,6 +52,8 @@ tests/cases/compiler/duplicateIdentifiersAcrossContainerBoundaries.ts(41,16): er
|
||||
|
||||
class Foo {
|
||||
static x: number;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
}
|
||||
|
||||
module Foo {
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
tests/cases/compiler/duplicateInterfaceMembers1.ts(2,4): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/compiler/duplicateInterfaceMembers1.ts(3,4): error TS2300: Duplicate identifier 'x'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateInterfaceMembers1.ts (1 errors) ====
|
||||
==== tests/cases/compiler/duplicateInterfaceMembers1.ts (2 errors) ====
|
||||
interface Bar {
|
||||
x: number;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
x: number;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
|
||||
@@ -2,16 +2,22 @@ tests/cases/compiler/duplicateObjectLiteralProperty.ts(14,9): error TS1056: Acce
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(15,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(16,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(16,9): error TS1118: An object literal cannot have multiple get/set accessors with the same name.
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(2,5): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(4,5): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(5,5): error TS2300: Duplicate identifier '\u0061'.
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(6,5): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(7,9): error TS2300: Duplicate identifier 'c'.
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(8,9): error TS2300: Duplicate identifier '"c"'.
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(14,9): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(15,9): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/duplicateObjectLiteralProperty.ts(16,9): error TS2300: Duplicate identifier 'a'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateObjectLiteralProperty.ts (9 errors) ====
|
||||
==== tests/cases/compiler/duplicateObjectLiteralProperty.ts (13 errors) ====
|
||||
var x = {
|
||||
a: 1,
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
b: true, // OK
|
||||
a: 56, // Duplicate
|
||||
~
|
||||
@@ -23,6 +29,8 @@ tests/cases/compiler/duplicateObjectLiteralProperty.ts(16,9): error TS2300: Dupl
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
c: 1,
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'c'.
|
||||
"c": 56, // Duplicate
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '"c"'.
|
||||
@@ -34,9 +42,13 @@ tests/cases/compiler/duplicateObjectLiteralProperty.ts(16,9): error TS2300: Dupl
|
||||
get a() { return 0; },
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
set a(v: number) { },
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
get a() { return 0; }
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
tests/cases/compiler/duplicatePropertiesInStrictMode.ts(4,3): error TS1117: An object literal cannot have multiple properties with the same name in strict mode.
|
||||
tests/cases/compiler/duplicatePropertiesInStrictMode.ts(3,3): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/compiler/duplicatePropertiesInStrictMode.ts(4,3): error TS2300: Duplicate identifier 'x'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicatePropertiesInStrictMode.ts (2 errors) ====
|
||||
==== tests/cases/compiler/duplicatePropertiesInStrictMode.ts (3 errors) ====
|
||||
"use strict";
|
||||
var x = {
|
||||
x: 1,
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
x: 2
|
||||
~
|
||||
!!! error TS1117: An object literal cannot have multiple properties with the same name in strict mode.
|
||||
|
||||
@@ -1,20 +1,32 @@
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(4,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(5,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(14,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(15,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(19,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(20,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(22,5): error TS2393: Duplicate function implementation.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(23,5): error TS2393: Duplicate function implementation.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(25,5): error TS2300: Duplicate identifier 'baz'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(26,5): error TS2300: Duplicate identifier 'baz'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(30,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(31,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(35,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(36,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(38,5): error TS2300: Duplicate identifier 'bar'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(39,5): error TS2300: Duplicate identifier 'bar'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(43,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(44,5): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(45,5): error TS2300: Duplicate identifier 'bar'.
|
||||
tests/cases/conformance/types/members/duplicatePropertyNames.ts(46,5): error TS2300: Duplicate identifier 'bar'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/members/duplicatePropertyNames.ts (10 errors) ====
|
||||
==== tests/cases/conformance/types/members/duplicatePropertyNames.ts (20 errors) ====
|
||||
// duplicate property names are an error in all types
|
||||
|
||||
interface Number {
|
||||
foo: string;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
foo: string;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
@@ -27,6 +39,8 @@ tests/cases/conformance/types/members/duplicatePropertyNames.ts(46,5): error TS2
|
||||
|
||||
interface Array<T> {
|
||||
foo: T;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
foo: T;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
@@ -34,16 +48,22 @@ tests/cases/conformance/types/members/duplicatePropertyNames.ts(46,5): error TS2
|
||||
|
||||
class C {
|
||||
foo: string;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
foo: string;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
|
||||
bar(x) { }
|
||||
~~~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
bar(x) { }
|
||||
~~~~~~~~~~
|
||||
~~~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
|
||||
baz = () => { }
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'baz'.
|
||||
baz = () => { }
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'baz'.
|
||||
@@ -51,6 +71,8 @@ tests/cases/conformance/types/members/duplicatePropertyNames.ts(46,5): error TS2
|
||||
|
||||
interface I {
|
||||
foo: string;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
foo: string;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
@@ -58,11 +80,15 @@ tests/cases/conformance/types/members/duplicatePropertyNames.ts(46,5): error TS2
|
||||
|
||||
var a: {
|
||||
foo: string;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
foo: string;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
|
||||
bar: () => {};
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'bar'.
|
||||
bar: () => {};
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'bar'.
|
||||
@@ -70,10 +96,14 @@ tests/cases/conformance/types/members/duplicatePropertyNames.ts(46,5): error TS2
|
||||
|
||||
var b = {
|
||||
foo: '',
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
foo: '',
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
bar: () => { },
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'bar'.
|
||||
bar: () => { }
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'bar'.
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
tests/cases/compiler/duplicateStringNamedProperty1.ts(2,5): error TS2300: Duplicate identifier '"artist"'.
|
||||
tests/cases/compiler/duplicateStringNamedProperty1.ts(3,5): error TS2300: Duplicate identifier 'artist'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateStringNamedProperty1.ts (1 errors) ====
|
||||
==== tests/cases/compiler/duplicateStringNamedProperty1.ts (2 errors) ====
|
||||
export interface Album {
|
||||
"artist": string;
|
||||
~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier '"artist"'.
|
||||
artist: string;
|
||||
~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'artist'.
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
tests/cases/compiler/enumGenericTypeClash.ts(1,7): error TS2300: Duplicate identifier 'X'.
|
||||
tests/cases/compiler/enumGenericTypeClash.ts(2,6): error TS2300: Duplicate identifier 'X'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/enumGenericTypeClash.ts (1 errors) ====
|
||||
==== tests/cases/compiler/enumGenericTypeClash.ts (2 errors) ====
|
||||
class X<A,B,C> { }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'X'.
|
||||
enum X { MyVal }
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'X'.
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
tests/cases/compiler/enumIdenticalIdentifierValues.ts(2,5): error TS2300: Duplicate identifier '1'.
|
||||
tests/cases/compiler/enumIdenticalIdentifierValues.ts(3,5): error TS2300: Duplicate identifier '1.0'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/enumIdenticalIdentifierValues.ts (1 errors) ====
|
||||
==== tests/cases/compiler/enumIdenticalIdentifierValues.ts (2 errors) ====
|
||||
enum Enum {
|
||||
1,
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier '1'.
|
||||
1.0
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier '1.0'.
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
tests/cases/compiler/es6ClassTest9.ts(1,18): error TS1005: '{' expected.
|
||||
tests/cases/compiler/es6ClassTest9.ts(1,19): error TS1109: Expression expected.
|
||||
tests/cases/compiler/es6ClassTest9.ts(1,15): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/compiler/es6ClassTest9.ts(2,10): error TS2300: Duplicate identifier 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/es6ClassTest9.ts (3 errors) ====
|
||||
==== tests/cases/compiler/es6ClassTest9.ts (4 errors) ====
|
||||
declare class foo();
|
||||
~
|
||||
!!! error TS1005: '{' expected.
|
||||
~
|
||||
!!! error TS1109: Expression expected.
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
function foo() {}
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
tests/cases/compiler/exportSameNameFuncVar.ts(1,12): error TS2300: Duplicate identifier 'a'.
|
||||
tests/cases/compiler/exportSameNameFuncVar.ts(2,17): error TS2300: Duplicate identifier 'a'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/exportSameNameFuncVar.ts (1 errors) ====
|
||||
==== tests/cases/compiler/exportSameNameFuncVar.ts (2 errors) ====
|
||||
export var a = 10;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
export function a() {
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'a'.
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
tests/cases/compiler/extension.ts(16,5): error TS1128: Declaration or statement expected.
|
||||
tests/cases/compiler/extension.ts(16,22): error TS1005: ';' expected.
|
||||
tests/cases/compiler/extension.ts(10,18): error TS2300: Duplicate identifier 'C'.
|
||||
tests/cases/compiler/extension.ts(16,12): error TS2304: Cannot find name 'extension'.
|
||||
tests/cases/compiler/extension.ts(16,28): error TS2300: Duplicate identifier 'C'.
|
||||
tests/cases/compiler/extension.ts(22,3): error TS2339: Property 'pe' does not exist on type 'C'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/extension.ts (5 errors) ====
|
||||
==== tests/cases/compiler/extension.ts (6 errors) ====
|
||||
interface I {
|
||||
x;
|
||||
}
|
||||
@@ -16,6 +17,8 @@ tests/cases/compiler/extension.ts(22,3): error TS2339: Property 'pe' does not ex
|
||||
|
||||
declare module M {
|
||||
export class C {
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'C'.
|
||||
public p:number;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
tests/cases/compiler/fieldAndGetterWithSameName.ts(3,7): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/fieldAndGetterWithSameName.ts(2,5): error TS2300: Duplicate identifier 'x'.
|
||||
tests/cases/compiler/fieldAndGetterWithSameName.ts(3,7): error TS2300: Duplicate identifier 'x'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/fieldAndGetterWithSameName.ts (2 errors) ====
|
||||
==== tests/cases/compiler/fieldAndGetterWithSameName.ts (3 errors) ====
|
||||
export class C {
|
||||
x: number;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'x'.
|
||||
get x(): number { return 1; }
|
||||
~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
|
||||
@@ -1,11 +1,21 @@
|
||||
tests/cases/compiler/funClodule.ts(1,18): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/compiler/funClodule.ts(2,16): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/compiler/funClodule.ts(5,15): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/compiler/funClodule.ts(8,15): error TS2300: Duplicate identifier 'foo2'.
|
||||
tests/cases/compiler/funClodule.ts(9,16): error TS2300: Duplicate identifier 'foo2'.
|
||||
tests/cases/compiler/funClodule.ts(12,18): error TS2300: Duplicate identifier 'foo2'.
|
||||
tests/cases/compiler/funClodule.ts(15,10): error TS2300: Duplicate identifier 'foo3'.
|
||||
tests/cases/compiler/funClodule.ts(16,8): error TS2300: Duplicate identifier 'foo3'.
|
||||
tests/cases/compiler/funClodule.ts(19,7): error TS2300: Duplicate identifier 'foo3'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/funClodule.ts (3 errors) ====
|
||||
==== tests/cases/compiler/funClodule.ts (9 errors) ====
|
||||
declare function foo();
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
declare module foo {
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
export function x(): any;
|
||||
}
|
||||
declare class foo { } // Should error
|
||||
@@ -14,7 +24,11 @@ tests/cases/compiler/funClodule.ts(19,7): error TS2300: Duplicate identifier 'fo
|
||||
|
||||
|
||||
declare class foo2 { }
|
||||
~~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo2'.
|
||||
declare module foo2 {
|
||||
~~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo2'.
|
||||
export function x(): any;
|
||||
}
|
||||
declare function foo2(); // Should error
|
||||
@@ -23,7 +37,11 @@ tests/cases/compiler/funClodule.ts(19,7): error TS2300: Duplicate identifier 'fo
|
||||
|
||||
|
||||
function foo3() { }
|
||||
~~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo3'.
|
||||
module foo3 {
|
||||
~~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo3'.
|
||||
export function x(): any { }
|
||||
}
|
||||
class foo3 { } // Should error
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
tests/cases/compiler/functionAndPropertyNameConflict.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/functionAndPropertyNameConflict.ts(2,12): error TS2300: Duplicate identifier 'aaaaa'.
|
||||
tests/cases/compiler/functionAndPropertyNameConflict.ts(3,16): error TS2300: Duplicate identifier 'aaaaa'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/functionAndPropertyNameConflict.ts (2 errors) ====
|
||||
==== tests/cases/compiler/functionAndPropertyNameConflict.ts (3 errors) ====
|
||||
class C65 {
|
||||
public aaaaa() { }
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'aaaaa'.
|
||||
public get aaaaa() {
|
||||
~~~~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
tests/cases/compiler/functionCall15.ts(1,25): error TS2300: Duplicate identifier 'b'.
|
||||
tests/cases/compiler/functionCall15.ts(1,39): error TS2300: Duplicate identifier 'b'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/functionCall15.ts (1 errors) ====
|
||||
==== tests/cases/compiler/functionCall15.ts (2 errors) ====
|
||||
function foo(a?:string, b?:number, ...b:number[]){}
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'b'.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'b'.
|
||||
@@ -1,39 +1,54 @@
|
||||
tests/cases/conformance/functions/functionNameConflicts.ts(5,14): error TS2300: Duplicate identifier 'fn1'.
|
||||
tests/cases/conformance/functions/functionNameConflicts.ts(6,9): error TS2300: Duplicate identifier 'fn1'.
|
||||
tests/cases/conformance/functions/functionNameConflicts.ts(8,9): error TS2300: Duplicate identifier 'fn2'.
|
||||
tests/cases/conformance/functions/functionNameConflicts.ts(9,14): error TS2300: Duplicate identifier 'fn2'.
|
||||
tests/cases/conformance/functions/functionNameConflicts.ts(12,10): error TS2300: Duplicate identifier 'fn3'.
|
||||
tests/cases/conformance/functions/functionNameConflicts.ts(13,5): error TS2300: Duplicate identifier 'fn3'.
|
||||
tests/cases/conformance/functions/functionNameConflicts.ts(16,9): error TS2300: Duplicate identifier 'fn4'.
|
||||
tests/cases/conformance/functions/functionNameConflicts.ts(17,14): error TS2300: Duplicate identifier 'fn4'.
|
||||
tests/cases/conformance/functions/functionNameConflicts.ts(19,14): error TS2300: Duplicate identifier 'fn5'.
|
||||
tests/cases/conformance/functions/functionNameConflicts.ts(20,9): error TS2300: Duplicate identifier 'fn5'.
|
||||
tests/cases/conformance/functions/functionNameConflicts.ts(24,10): error TS2389: Function implementation name must be 'over'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/functions/functionNameConflicts.ts (6 errors) ====
|
||||
==== tests/cases/conformance/functions/functionNameConflicts.ts (11 errors) ====
|
||||
//Function and variable of the same name in same declaration space
|
||||
//Function overload with different name from implementation signature
|
||||
|
||||
module M {
|
||||
function fn1() { }
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'fn1'.
|
||||
var fn1;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'fn1'.
|
||||
|
||||
var fn2;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'fn2'.
|
||||
function fn2() { }
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'fn2'.
|
||||
}
|
||||
|
||||
function fn3() { }
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'fn3'.
|
||||
var fn3;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'fn3'.
|
||||
|
||||
function func() {
|
||||
var fn4;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'fn4'.
|
||||
function fn4() { }
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'fn4'.
|
||||
|
||||
function fn5() { }
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'fn5'.
|
||||
var fn5;
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'fn5'.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user