Subsequent variable declarations must have same type: Mention location of other declaration (#19356)

* Subsequent variable declarations must have same type: Mention location of other declaration

* Fix naming, remove template literal
This commit is contained in:
Andy
2017-10-20 08:33:16 -07:00
committed by GitHub
parent 1ea1254e8e
commit d7be61a569
57 changed files with 281 additions and 267 deletions
+20 -6
View File
@@ -560,10 +560,10 @@ namespace ts {
return emitResolver;
}
function error(location: Node, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number): void {
function error(location: Node, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): void {
const diagnostic = location
? createDiagnosticForNode(location, message, arg0, arg1, arg2)
: createCompilerDiagnostic(message, arg0, arg1, arg2);
? createDiagnosticForNode(location, message, arg0, arg1, arg2, arg3)
: createCompilerDiagnostic(message, arg0, arg1, arg2, arg3);
diagnostics.add(diagnostic);
}
@@ -4417,8 +4417,7 @@ namespace ts {
jsDocType = declarationType;
}
else if (jsDocType !== unknownType && declarationType !== unknownType && !isTypeIdenticalTo(jsDocType, declarationType)) {
const name = getNameOfDeclaration(declaration);
error(name, Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, declarationNameToString(name), typeToString(jsDocType), typeToString(declarationType));
errorNextVariableDeclarationMustHaveSameType(symbol.valueDeclaration, jsDocType, declaration, declarationType);
}
}
else if (!jsDocType) {
@@ -20779,7 +20778,7 @@ namespace ts {
// initializer is consistent with type associated with the node
const declarationType = convertAutoToAny(getWidenedTypeForVariableLikeDeclaration(node));
if (type !== unknownType && declarationType !== unknownType && !isTypeIdenticalTo(type, declarationType)) {
error(node.name, Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2, declarationNameToString(node.name), typeToString(type), typeToString(declarationType));
errorNextVariableDeclarationMustHaveSameType(symbol.valueDeclaration, type, node, declarationType);
}
if (node.initializer) {
checkTypeAssignableTo(checkExpressionCached(node.initializer), declarationType, node, /*headMessage*/ undefined);
@@ -20803,6 +20802,21 @@ namespace ts {
}
}
function errorNextVariableDeclarationMustHaveSameType(firstDeclaration: Declaration, firstType: Type, nextDeclaration: Declaration, nextType: Type): void {
const firstSourceFile = getSourceFileOfNode(firstDeclaration);
const firstSpan = getErrorSpanForNode(firstSourceFile, getNameOfDeclaration(firstDeclaration) || firstDeclaration);
const firstLocation = getLineAndCharacterOfPosition(firstSourceFile, firstSpan.start);
const firstLocationDescription = firstSourceFile.fileName + " " + firstLocation.line + ":" + firstLocation.character;
const nextDeclarationName = getNameOfDeclaration(nextDeclaration);
error(
nextDeclarationName,
Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_has_type_1_at_2_but_here_has_type_3,
declarationNameToString(nextDeclarationName),
typeToString(firstType),
firstLocationDescription,
typeToString(nextType));
}
function areDeclarationFlagsIdentical(left: Declaration, right: Declaration) {
if ((left.kind === SyntaxKind.Parameter && right.kind === SyntaxKind.VariableDeclaration) ||
(left.kind === SyntaxKind.VariableDeclaration && right.kind === SyntaxKind.Parameter)) {
+1 -1
View File
@@ -1316,7 +1316,7 @@
"category": "Error",
"code": 2402
},
"Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'.": {
"Subsequent variable declarations must have the same type. Variable '{0}' has type '{1}' at {2}, but here has type '{3}'.": {
"category": "Error",
"code": 2403
},
+4 -4
View File
@@ -582,14 +582,14 @@ namespace ts {
}
}
export function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number): Diagnostic {
export function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): Diagnostic {
const sourceFile = getSourceFileOfNode(node);
return createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2);
return createDiagnosticForNodeInSourceFile(sourceFile, node, message, arg0, arg1, arg2, arg3);
}
export function createDiagnosticForNodeInSourceFile(sourceFile: SourceFile, node: Node, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number): Diagnostic {
export function createDiagnosticForNodeInSourceFile(sourceFile: SourceFile, node: Node, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): Diagnostic {
const span = getErrorSpanForNode(sourceFile, node);
return createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2);
return createFileDiagnostic(sourceFile, span.start, span.length, message, arg0, arg1, arg2, arg3);
}
export function createDiagnosticForNodeFromMessageChain(node: Node, messageChain: DiagnosticMessageChain): Diagnostic {
@@ -1,4 +1,4 @@
tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts(6,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'any[]'.
tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts(6,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts 1:8, but here has type 'any[]'.
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts (1 errors) ====
@@ -9,5 +9,5 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts(6,9): error TS
for (var v of []) {
var x = [w, v];
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'any[]'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts 1:8, but here has type 'any[]'.
}
@@ -1,6 +1,6 @@
tests/cases/conformance/internalModules/DeclarationMerging/module.ts(2,19): error TS2433: A namespace declaration cannot be in a different file from a class or function with which it is merged.
tests/cases/conformance/internalModules/DeclarationMerging/simple.ts(13,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'.
tests/cases/conformance/internalModules/DeclarationMerging/test.ts(2,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'.
tests/cases/conformance/internalModules/DeclarationMerging/simple.ts(13,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' has type '() => { x: number; y: number; }' at tests/cases/conformance/internalModules/DeclarationMerging/test.ts 0:4, but here has type 'typeof Point'.
tests/cases/conformance/internalModules/DeclarationMerging/test.ts(2,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' has type '() => { x: number; y: number; }' at tests/cases/conformance/internalModules/DeclarationMerging/test.ts 0:4, but here has type 'typeof Point'.
==== tests/cases/conformance/internalModules/DeclarationMerging/function.ts (0 errors) ====
@@ -23,7 +23,7 @@ tests/cases/conformance/internalModules/DeclarationMerging/test.ts(2,5): error T
var fn: () => { x: number; y: number };
var fn = A.Point;
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' has type '() => { x: number; y: number; }' at tests/cases/conformance/internalModules/DeclarationMerging/test.ts 0:4, but here has type 'typeof Point'.
var cl: { x: number; y: number; }
var cl = A.Point();
@@ -45,7 +45,7 @@ tests/cases/conformance/internalModules/DeclarationMerging/test.ts(2,5): error T
var fn: () => { x: number; y: number };
var fn = B.Point; // not expected to be an error. bug 840000: [corelang] Function of fundule not assignalbe as expected
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' must be of type '() => { x: number; y: number; }', but here has type 'typeof Point'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'fn' has type '() => { x: number; y: number; }' at tests/cases/conformance/internalModules/DeclarationMerging/test.ts 0:4, but here has type 'typeof Point'.
var cl: { x: number; y: number; }
var cl = B.Point();
@@ -1,7 +1,7 @@
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,11): error TS2304: Cannot find name 'async'.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,18): error TS2304: Cannot find name 'await'.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,24): error TS1005: ',' expected.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'void'.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,33): error TS1005: '=' expected.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es2017.ts(1,40): error TS1109: Expression expected.
@@ -15,7 +15,7 @@ tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction5_es20
~
!!! error TS1005: ',' expected.
~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'void'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'.
~
!!! error TS1005: '=' expected.
~~
@@ -1,7 +1,7 @@
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,11): error TS2304: Cannot find name 'async'.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,18): error TS2304: Cannot find name 'await'.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,24): error TS1005: ',' expected.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'void'.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,33): error TS1005: '=' expected.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(1,40): error TS1109: Expression expected.
@@ -15,7 +15,7 @@ tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction5_es5.ts(
~
!!! error TS1005: ',' expected.
~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'void'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'.
~
!!! error TS1005: '=' expected.
~~
@@ -1,7 +1,7 @@
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,11): error TS2304: Cannot find name 'async'.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,18): error TS2304: Cannot find name 'await'.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,24): error TS1005: ',' expected.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'void'.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,26): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,33): error TS1005: '=' expected.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(1,40): error TS1109: Expression expected.
@@ -15,7 +15,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction5_es6.ts(
~
!!! error TS1005: ',' expected.
~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'void'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'.
~
!!! error TS1005: '=' expected.
~~
@@ -1,7 +1,7 @@
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,11): error TS2304: Cannot find name 'async'.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,18): error TS2304: Cannot find name 'a'.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,37): error TS1005: ',' expected.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'void'.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,46): error TS1005: '=' expected.
tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es2017.ts(1,53): error TS1109: Expression expected.
@@ -15,7 +15,7 @@ tests/cases/conformance/async/es2017/asyncArrowFunction/asyncArrowFunction9_es20
~
!!! error TS1005: ',' expected.
~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'void'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'.
~
!!! error TS1005: '=' expected.
~~
@@ -1,7 +1,7 @@
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,11): error TS2304: Cannot find name 'async'.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,18): error TS2304: Cannot find name 'a'.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,37): error TS1005: ',' expected.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'void'.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,46): error TS1005: '=' expected.
tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(1,53): error TS1109: Expression expected.
@@ -15,7 +15,7 @@ tests/cases/conformance/async/es5/asyncArrowFunction/asyncArrowFunction9_es5.ts(
~
!!! error TS1005: ',' expected.
~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'void'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'.
~
!!! error TS1005: '=' expected.
~~
@@ -1,7 +1,7 @@
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,11): error TS2304: Cannot find name 'async'.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,18): error TS2304: Cannot find name 'a'.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,37): error TS1005: ',' expected.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'void'.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,39): error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,46): error TS1005: '=' expected.
tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(1,53): error TS1109: Expression expected.
@@ -15,7 +15,7 @@ tests/cases/conformance/async/es6/asyncArrowFunction/asyncArrowFunction9_es6.ts(
~
!!! error TS1005: ',' expected.
~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' must be of type 'PromiseConstructor', but here has type 'void'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Promise' has type 'PromiseConstructor' at lib.es2015.promise.d.ts 222:12, but here has type 'void'.
~
!!! error TS1005: '=' expected.
~~
@@ -1,6 +1,6 @@
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(10,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' has type 'number' at tests/cases/compiler/augmentedTypesVar.ts 8:4, 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'.
@@ -29,7 +29,7 @@ tests/cases/compiler/augmentedTypesVar.ts(31,8): error TS2300: Duplicate identif
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'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' has type 'number' at tests/cases/compiler/augmentedTypesVar.ts 8:4, but here has type '() => void'.
// var then class
var x4 = 1; // error
@@ -3,7 +3,7 @@ tests/cases/conformance/types/tuple/castingTuple.ts(28,10): error TS2352: Type '
tests/cases/conformance/types/tuple/castingTuple.ts(29,10): error TS2352: Type '[C, D]' cannot be converted to type '[A, I]'.
Type 'C' is not comparable to type 'A'.
Property 'a' is missing in type 'C'.
tests/cases/conformance/types/tuple/castingTuple.ts(30,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(30,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' has type '{}[]' at tests/cases/conformance/types/tuple/castingTuple.ts 20:4, but here has type 'number[]'.
tests/cases/conformance/types/tuple/castingTuple.ts(31,1): error TS2304: Cannot find name 't4'.
@@ -46,7 +46,7 @@ tests/cases/conformance/types/tuple/castingTuple.ts(31,1): error TS2304: Cannot
!!! error TS2352: 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 TS2403: Subsequent variable declarations must have the same type. Variable 'array1' has type '{}[]' at tests/cases/conformance/types/tuple/castingTuple.ts 20:4, but here has type 'number[]'.
t4[2] = 10;
~~
!!! error TS2304: Cannot find name 't4'.
@@ -2,7 +2,7 @@ tests/cases/compiler/classWithDuplicateIdentifier.ts(3,5): error TS2300: Duplica
tests/cases/compiler/classWithDuplicateIdentifier.ts(6,5): error TS2300: Duplicate identifier 'b'.
tests/cases/compiler/classWithDuplicateIdentifier.ts(7,5): error TS2300: Duplicate identifier 'b'.
tests/cases/compiler/classWithDuplicateIdentifier.ts(11,5): error TS2300: Duplicate identifier 'c'.
tests/cases/compiler/classWithDuplicateIdentifier.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'c' must be of type 'number', but here has type 'string'.
tests/cases/compiler/classWithDuplicateIdentifier.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'c' has type 'number' at tests/cases/compiler/classWithDuplicateIdentifier.ts 9:4, but here has type 'string'.
==== tests/cases/compiler/classWithDuplicateIdentifier.ts (5 errors) ====
@@ -26,6 +26,6 @@ tests/cases/compiler/classWithDuplicateIdentifier.ts(11,5): error TS2403: Subseq
~
!!! error TS2300: Duplicate identifier 'c'.
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'c' must be of type 'number', but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'c' has type 'number' at tests/cases/compiler/classWithDuplicateIdentifier.ts 9:4, but here has type 'string'.
}
@@ -5,7 +5,7 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(23,25):
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(24,19): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{ y: any; }'.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(28,28): error TS2353: Object literal may only specify known properties, and 'y' does not exist in type '{ x: any; }'.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(29,22): error TS2353: Object literal may only specify known properties, and 'x' does not exist in type '{ y: any; }'.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(58,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string | 1', but here has type 'string'.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(58,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string | 1' at tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts 55:16, but here has type 'string'.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,10): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,13): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(62,16): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
@@ -99,7 +99,7 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9):
var x: number;
var y: string;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string | 1', but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string | 1' at tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts 55:16, but here has type 'string'.
}
function f8() {
@@ -16,7 +16,7 @@ tests/cases/compiler/duplicateClassElements.ts(26,9): error TS2300: Duplicate id
tests/cases/compiler/duplicateClassElements.ts(29,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/duplicateClassElements.ts(32,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/duplicateClassElements.ts(34,12): error TS2300: Duplicate identifier 'x2'.
tests/cases/compiler/duplicateClassElements.ts(34,12): error TS2403: Subsequent variable declarations must have the same type. Variable 'x2' must be of type 'number', but here has type 'any'.
tests/cases/compiler/duplicateClassElements.ts(34,12): error TS2403: Subsequent variable declarations must have the same type. Variable 'x2' has type 'number' at tests/cases/compiler/duplicateClassElements.ts 28:8, but here has type 'any'.
tests/cases/compiler/duplicateClassElements.ts(36,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/duplicateClassElements.ts(36,9): error TS2300: Duplicate identifier 'z2'.
tests/cases/compiler/duplicateClassElements.ts(39,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -96,7 +96,7 @@ tests/cases/compiler/duplicateClassElements.ts(41,12): error TS2300: Duplicate i
~~
!!! error TS2300: Duplicate identifier 'x2'.
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x2' must be of type 'number', but here has type 'any'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x2' has type 'number' at tests/cases/compiler/duplicateClassElements.ts 28:8, but here has type 'any'.
get z2() {
~~
@@ -4,7 +4,7 @@ tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(6,10): error TS2300: Dup
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(16,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'string' at tests/cases/compiler/duplicateIdentifierInCatchBlock.ts 14:8, but here has type 'number'.
==== tests/cases/compiler/duplicateIdentifierInCatchBlock.ts (7 errors) ====
@@ -37,5 +37,5 @@ tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(16,9): error TS2403: Sub
var p: string;
var p: number; // error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'string', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'string' at tests/cases/compiler/duplicateIdentifierInCatchBlock.ts 14:8, but here has type 'number'.
}
@@ -1,7 +1,7 @@
tests/cases/compiler/duplicateLocalVariable1.ts(1,4): error TS1005: ';' expected.
tests/cases/compiler/duplicateLocalVariable1.ts(1,11): error TS1146: Declaration expected.
tests/cases/compiler/duplicateLocalVariable1.ts(1,13): error TS2304: Cannot find name 'commonjs'.
tests/cases/compiler/duplicateLocalVariable1.ts(186,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'.
tests/cases/compiler/duplicateLocalVariable1.ts(186,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'string' at tests/cases/compiler/duplicateLocalVariable1.ts 180:21, but here has type 'number'.
tests/cases/compiler/duplicateLocalVariable1.ts(186,29): error TS2365: Operator '<' cannot be applied to types 'string' and 'number'.
tests/cases/compiler/duplicateLocalVariable1.ts(186,37): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
@@ -200,7 +200,7 @@ tests/cases/compiler/duplicateLocalVariable1.ts(186,37): error TS2356: An arithm
var bytes = [];
for (var i = 0; i < 14; i++) {
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'string' at tests/cases/compiler/duplicateLocalVariable1.ts 180:21, but here has type 'number'.
~~~~~~
!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'number'.
~
@@ -1,4 +1,4 @@
tests/cases/compiler/duplicateLocalVariable2.ts(27,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'.
tests/cases/compiler/duplicateLocalVariable2.ts(27,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'string' at tests/cases/compiler/duplicateLocalVariable2.ts 21:21, but here has type 'number'.
tests/cases/compiler/duplicateLocalVariable2.ts(27,29): error TS2365: Operator '<' cannot be applied to types 'string' and 'number'.
tests/cases/compiler/duplicateLocalVariable2.ts(27,37): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
@@ -32,7 +32,7 @@ tests/cases/compiler/duplicateLocalVariable2.ts(27,37): error TS2356: An arithme
var bytes = [];
for (var i = 0; i < 14; i++) {
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'string' at tests/cases/compiler/duplicateLocalVariable2.ts 21:21, but here has type 'number'.
~~~~~~
!!! error TS2365: Operator '<' cannot be applied to types 'string' and 'number'.
~
@@ -1,4 +1,4 @@
tests/cases/compiler/duplicateLocalVariable3.ts(11,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'string'.
tests/cases/compiler/duplicateLocalVariable3.ts(11,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' has type 'number' at tests/cases/compiler/duplicateLocalVariable3.ts 9:8, but here has type 'string'.
==== tests/cases/compiler/duplicateLocalVariable3.ts (1 errors) ====
@@ -14,5 +14,5 @@ tests/cases/compiler/duplicateLocalVariable3.ts(11,9): error TS2403: Subsequent
var z = 3;
var z = "";
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' has type 'number' at tests/cases/compiler/duplicateLocalVariable3.ts 9:8, but here has type 'string'.
}
@@ -1,4 +1,4 @@
tests/cases/compiler/duplicateLocalVariable4.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'typeof E', but here has type 'E'.
tests/cases/compiler/duplicateLocalVariable4.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'typeof E' at tests/cases/compiler/duplicateLocalVariable4.ts 4:4, but here has type 'E'.
==== tests/cases/compiler/duplicateLocalVariable4.ts (1 errors) ====
@@ -9,4 +9,4 @@ tests/cases/compiler/duplicateLocalVariable4.ts(6,5): error TS2403: Subsequent v
var x = E;
var x = E.a;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'typeof E', but here has type 'E'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'typeof E' at tests/cases/compiler/duplicateLocalVariable4.ts 4:4, but here has type 'E'.
@@ -1,7 +1,7 @@
tests/cases/compiler/duplicateVariablesWithAny.ts(3,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'.
tests/cases/compiler/duplicateVariablesWithAny.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'.
tests/cases/compiler/duplicateVariablesWithAny.ts(10,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'.
tests/cases/compiler/duplicateVariablesWithAny.ts(13,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'.
tests/cases/compiler/duplicateVariablesWithAny.ts(3,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/compiler/duplicateVariablesWithAny.ts 1:4, but here has type 'number'.
tests/cases/compiler/duplicateVariablesWithAny.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string' at tests/cases/compiler/duplicateVariablesWithAny.ts 4:4, but here has type 'any'.
tests/cases/compiler/duplicateVariablesWithAny.ts(10,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/compiler/duplicateVariablesWithAny.ts 8:8, but here has type 'number'.
tests/cases/compiler/duplicateVariablesWithAny.ts(13,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string' at tests/cases/compiler/duplicateVariablesWithAny.ts 11:8, but here has type 'any'.
==== tests/cases/compiler/duplicateVariablesWithAny.ts (4 errors) ====
@@ -9,23 +9,23 @@ tests/cases/compiler/duplicateVariablesWithAny.ts(13,9): error TS2403: Subsequen
var x: any;
var x = 2; //error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/compiler/duplicateVariablesWithAny.ts 1:4, but here has type 'number'.
var y = "";
var y; //error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string' at tests/cases/compiler/duplicateVariablesWithAny.ts 4:4, but here has type 'any'.
module N {
var x: any;
var x = 2; //error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/compiler/duplicateVariablesWithAny.ts 8:8, but here has type 'number'.
var y = "";
var y; //error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'any'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string' at tests/cases/compiler/duplicateVariablesWithAny.ts 11:8, but here has type 'any'.
}
var z: any;
@@ -1,7 +1,7 @@
tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'boolean'.
tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'string'.
tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(2,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'number'.
tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(3,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'boolean'.
tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'number' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts 0:4, but here has type 'boolean'.
tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'number' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts 0:4, but here has type 'string'.
tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(2,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts 1:4, but here has type 'number'.
tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(3,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'z' has type 'number' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts 1:4, but here has type 'boolean'.
==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts (0 errors) ====
@@ -11,19 +11,19 @@ tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(3,5): error TS2403:
==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts (1 errors) ====
var x = true;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'boolean'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'number' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts 0:4, but here has type 'boolean'.
var z = 3;
==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts (3 errors) ====
var x = "";
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'number', but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'number' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts 0:4, but here has type 'string'.
var y = 3;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'string' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts 1:4, but here has type 'number'.
var z = false;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'boolean'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' has type 'number' at tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts 1:4, but here has type 'boolean'.
==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_3.ts (0 errors) ====
var x = 0;
@@ -1,5 +1,5 @@
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts(104,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts(109,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts(104,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'E' at tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts 21:4, but here has type 'Object'.
tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts(109,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'E' at tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts 21:4, but here has type 'Object'.
==== tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts (2 errors) ====
@@ -108,11 +108,11 @@ tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssi
var r4 = foo16(E.A);
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'E' at tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts 21:4, but here has type 'Object'.
declare function foo17(x: {}): {};
declare function foo17(x: E): E;
var r4 = foo16(E.A);
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'E' at tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts 21:4, but here has type 'Object'.
@@ -1,5 +1,5 @@
tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(33,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'.
tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(50,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'.
tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(33,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatements.ts 30:17, but here has type 'keyof this'.
tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(50,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatements.ts 47:17, but here has type 'keyof this'.
tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(79,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
@@ -38,7 +38,7 @@ tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(79,15):
for (var x in this.biz) { }
for (var x in this) { }
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatements.ts 30:17, but here has type 'keyof this'.
return null;
}
@@ -57,7 +57,7 @@ tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(79,15):
for (var x in this.biz) { }
for (var x in this) { }
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatements.ts 47:17, but here has type 'keyof this'.
for (var x in super.biz) { }
for (var x in super.biz()) { }
@@ -2,8 +2,8 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(5,16): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(6,9): error TS2365: Operator '===' cannot be applied to types 'string' and 'number'.
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(8,16): error TS2339: Property 'unknownProperty' does not exist on type 'string'.
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(12,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'number', but here has type 'string'.
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(16,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type 'any', but here has type 'string'.
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(12,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'number' at tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts 10:4, but here has type 'string'.
tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts(16,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'j' has type 'any' at tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts 14:4, but here has type 'string'.
==== tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts (6 errors) ====
@@ -28,12 +28,12 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.
var i: number;
for (var i in a ) {
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'number', but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type 'number' at tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts 10:4, but here has type 'string'.
}
var j: any;
for (var j in a ) {
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type 'any', but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'j' has type 'any' at tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts 14:4, but here has type 'string'.
}
@@ -9,10 +9,10 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(1
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(20,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(22,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(29,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(31,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(31,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts 28:17, but here has type 'keyof this'.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(38,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(46,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(48,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(48,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts 45:17, but here has type 'keyof this'.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(51,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(62,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
@@ -72,7 +72,7 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(6
for (var x in this.biz) { }
for (var x in this) { }
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts 28:17, but here has type 'keyof this'.
return null;
}
@@ -95,7 +95,7 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(6
for (var x in this.biz) { }
for (var x in this) { }
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'keyof this'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts 45:17, but here has type 'keyof this'.
for (var x in super.biz) { }
for (var x in super.biz()) { }
@@ -1,15 +1,15 @@
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(32,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(33,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(34,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(35,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D<string>'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(36,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(39,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(40,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(43,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(46,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(47,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '(C | D<string>)[]'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(50,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D<string>[]', but here has type 'D<number>[]'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(53,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(32,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'number'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(33,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'string'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(34,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'C'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(35,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'D<string>'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(36,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'typeof M'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(39,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 37:9, but here has type 'C'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(40,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 37:9, but here has type 'C2'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(43,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'f' has type '(x: string) => number' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 41:8, but here has type '(x: number) => string'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(46,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 44:8, but here has type 'number[]'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(47,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 44:8, but here has type '(C | D<string>)[]'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(50,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' has type 'D<string>[]' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 48:8, but here has type 'D<number>[]'.
tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts(53,10): error TS2403: Subsequent variable declarations must have the same type. Variable 'm' has type 'typeof M' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 51:8, but here has type 'typeof A'.
==== tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts (12 errors) ====
@@ -46,47 +46,47 @@ tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDec
for( var a: any;;){}
for( var a = 1;;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'number'.
for( var a = 'a string';;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'string'.
for( var a = new C();;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'C'.
for( var a = new D<string>();;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D<string>'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'D<string>'.
for( var a = M;;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 30:9, but here has type 'typeof M'.
for( var b: I;;){}
for( var b = new C();;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 37:9, but here has type 'C'.
for( var b = new C2();;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 37:9, but here has type 'C2'.
for(var f = F;;){}
for( var f = (x: number) => '';;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'f' has type '(x: string) => number' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 41:8, but here has type '(x: number) => string'.
for(var arr: string[];;){}
for( var arr = [1, 2, 3, 4];;){}
~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 44:8, but here has type 'number[]'.
for( var arr = [new C(), new C2(), new D<string>()];;){}
~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '(C | D<string>)[]'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 44:8, but here has type '(C | D<string>)[]'.
for(var arr2 = [new D<string>()];;){}
for( var arr2 = new Array<D<number>>();;){}
~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D<string>[]', but here has type 'D<number>[]'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' has type 'D<string>[]' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 48:8, but here has type 'D<number>[]'.
for(var m: typeof M;;){}
for( var m = M.A;;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'm' has type 'typeof M' at tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts 51:8, but here has type 'typeof A'.
@@ -1,6 +1,6 @@
tests/cases/compiler/functionArgShadowing.ts(4,8): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'A', but here has type 'B'.
tests/cases/compiler/functionArgShadowing.ts(4,8): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'A' at tests/cases/compiler/functionArgShadowing.ts 2:13, but here has type 'B'.
tests/cases/compiler/functionArgShadowing.ts(5,8): error TS2339: Property 'bar' does not exist on type 'A'.
tests/cases/compiler/functionArgShadowing.ts(10,7): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'number', but here has type 'string'.
tests/cases/compiler/functionArgShadowing.ts(10,7): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'number' at tests/cases/compiler/functionArgShadowing.ts 8:20, but here has type 'string'.
==== tests/cases/compiler/functionArgShadowing.ts (3 errors) ====
@@ -9,7 +9,7 @@ tests/cases/compiler/functionArgShadowing.ts(10,7): error TS2403: Subsequent var
function foo(x: A) {
var x: B = new B();
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'A', but here has type 'B'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'A' at tests/cases/compiler/functionArgShadowing.ts 2:13, but here has type 'B'.
x.bar(); // the property bar does not exist on a value of type A
~~~
!!! error TS2339: Property 'bar' does not exist on type 'A'.
@@ -19,7 +19,7 @@ tests/cases/compiler/functionArgShadowing.ts(10,7): error TS2403: Subsequent var
constructor(public p: number) {
var p: string;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'number', but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'number' at tests/cases/compiler/functionArgShadowing.ts 8:20, but here has type 'string'.
var n: number = p;
}
@@ -1,7 +1,7 @@
tests/cases/compiler/gettersAndSettersErrors.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/gettersAndSettersErrors.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/gettersAndSettersErrors.ts(5,12): error TS2300: Duplicate identifier 'Foo'.
tests/cases/compiler/gettersAndSettersErrors.ts(5,12): error TS2403: Subsequent variable declarations must have the same type. Variable 'Foo' must be of type 'string', but here has type 'number'.
tests/cases/compiler/gettersAndSettersErrors.ts(5,12): error TS2403: Subsequent variable declarations must have the same type. Variable 'Foo' has type 'string' at tests/cases/compiler/gettersAndSettersErrors.ts 1:15, but here has type 'number'.
tests/cases/compiler/gettersAndSettersErrors.ts(6,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/gettersAndSettersErrors.ts(7,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/compiler/gettersAndSettersErrors.ts(11,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -23,7 +23,7 @@ tests/cases/compiler/gettersAndSettersErrors.ts(12,16): error TS2379: Getter and
~~~
!!! error TS2300: Duplicate identifier 'Foo'.
~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Foo' must be of type 'string', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'Foo' has type 'string' at tests/cases/compiler/gettersAndSettersErrors.ts 1:15, but here has type 'number'.
public get Goo(v:string):string {return null;} // error - getters must not have a parameter
~~~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -1,7 +1,7 @@
tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'g' must be of type '<T, U>(x: T, y: U) => T', but here has type '<T>(x: any, y: any) => any'.
tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'h' must be of type '<T, U>(x: T, y: U) => T', but here has type '(x: any, y: any) => any'.
tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type '<T, U>(x: T, y: U) => T', but here has type '<T, U>(x: any, y: string) => any'.
tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(14,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type '<T, U>(x: T, y: U) => T', but here has type '<T, U>(x: any, y: any) => string'.
tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'g' has type '<T, U>(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 3:4, but here has type '<T>(x: any, y: any) => any'.
tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'h' has type '<T, U>(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 6:4, but here has type '(x: any, y: any) => any'.
tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type '<T, U>(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 9:4, but here has type '<T, U>(x: any, y: string) => any'.
tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(14,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'j' has type '<T, U>(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 12:4, but here has type '<T, U>(x: any, y: any) => string'.
==== tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts (4 errors) ====
@@ -11,19 +11,19 @@ tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(14,5): err
var g: <T, U>(x: T, y: U) => T;
var g: <T>(x: any, y: any) => any;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'g' must be of type '<T, U>(x: T, y: U) => T', but here has type '<T>(x: any, y: any) => any'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'g' has type '<T, U>(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 3:4, but here has type '<T>(x: any, y: any) => any'.
var h: <T, U>(x: T, y: U) => T;
var h: (x: any, y: any) => any;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'h' must be of type '<T, U>(x: T, y: U) => T', but here has type '(x: any, y: any) => any'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'h' has type '<T, U>(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 6:4, but here has type '(x: any, y: any) => any'.
var i: <T, U>(x: T, y: U) => T;
var i: <T, U>(x: any, y: string) => any;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type '<T, U>(x: T, y: U) => T', but here has type '<T, U>(x: any, y: string) => any'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' has type '<T, U>(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 9:4, but here has type '<T, U>(x: any, y: string) => any'.
var j: <T, U>(x: T, y: U) => T;
var j: <T, U>(x: any, y: any) => string;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type '<T, U>(x: T, y: U) => T', but here has type '<T, U>(x: any, y: any) => string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'j' has type '<T, U>(x: T, y: U) => T' at tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts 12:4, but here has type '<T, U>(x: any, y: any) => string'.
@@ -2,7 +2,7 @@ tests/cases/compiler/interfaceDeclaration1.ts(2,5): error TS2300: Duplicate iden
tests/cases/compiler/interfaceDeclaration1.ts(3,5): error TS2300: Duplicate identifier 'item'.
tests/cases/compiler/interfaceDeclaration1.ts(7,5): error TS2300: Duplicate identifier 'item'.
tests/cases/compiler/interfaceDeclaration1.ts(8,5): error TS2300: Duplicate identifier 'item'.
tests/cases/compiler/interfaceDeclaration1.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'item' must be of type 'any', but here has type 'number'.
tests/cases/compiler/interfaceDeclaration1.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'item' has type 'any' at tests/cases/compiler/interfaceDeclaration1.ts 6:4, but here has type 'number'.
tests/cases/compiler/interfaceDeclaration1.ts(22,11): error TS2310: Type 'I5' recursively references itself as a base type.
tests/cases/compiler/interfaceDeclaration1.ts(35,7): error TS2420: Class 'C1' incorrectly implements interface 'I3'.
Property 'prototype' is missing in type 'C1'.
@@ -29,7 +29,7 @@ tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i
~~~~
!!! error TS2300: Duplicate identifier 'item'.
~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'item' must be of type 'any', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'item' has type 'any' at tests/cases/compiler/interfaceDeclaration1.ts 6:4, but here has type 'number'.
}
interface I3 {
@@ -1,15 +1,15 @@
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(32,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(33,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(34,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(35,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D<string>'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(36,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(39,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(40,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(43,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(46,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(47,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '(C | D<string>)[]'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(50,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D<string>[]', but here has type 'D<number>[]'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(53,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(32,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'number'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(33,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'string'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(34,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'C'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(35,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'D<string>'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(36,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'typeof M'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(39,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 37:4, but here has type 'C'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(40,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 37:4, but here has type 'C2'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(43,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'f' has type '(x: string) => number' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 41:4, but here has type '(x: number) => string'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(46,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 44:4, but here has type 'number[]'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(47,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 44:4, but here has type '(C | D<string>)[]'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(50,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' has type 'D<string>[]' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 48:4, but here has type 'D<number>[]'.
tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts(53,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'm' has type 'typeof M' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 51:4, but here has type 'typeof A'.
==== tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts (12 errors) ====
@@ -46,47 +46,47 @@ tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDec
var a: any;
var a = 1;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'number'.
var a = 'a string';
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'string'.
var a = new C();
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'C'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'C'.
var a = new D<string>();
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D<string>'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'D<string>'.
var a = M;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'typeof M'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' has type 'any' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 30:4, but here has type 'typeof M'.
var b: I;
var b = new C();
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 37:4, but here has type 'C'.
var b = new C2();
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'I', but here has type 'C2'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' has type 'I' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 37:4, but here has type 'C2'.
var f = F;
var f = (x: number) => '';
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'f' must be of type '(x: string) => number', but here has type '(x: number) => string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'f' has type '(x: string) => number' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 41:4, but here has type '(x: number) => string'.
var arr: string[];
var arr = [1, 2, 3, 4];
~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type 'number[]'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 44:4, but here has type 'number[]'.
var arr = [new C(), new C2(), new D<string>()];
~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '(C | D<string>)[]'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' has type 'string[]' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 44:4, but here has type '(C | D<string>)[]'.
var arr2 = [new D<string>()];
var arr2 = new Array<D<number>>();
~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D<string>[]', but here has type 'D<number>[]'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' has type 'D<string>[]' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 48:4, but here has type 'D<number>[]'.
var m: typeof M;
var m = M.A;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'm' has type 'typeof M' at tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts 51:4, but here has type 'typeof A'.
@@ -1,5 +1,5 @@
error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
tests/cases/compiler/a.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'.
tests/cases/compiler/a.ts(1,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/compiler/b.js 0:4, but here has type 'number'.
!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
@@ -9,4 +9,4 @@ tests/cases/compiler/a.ts(1,5): error TS2403: Subsequent variable declarations m
==== tests/cases/compiler/a.ts (1 errors) ====
var x = 10; // Error reported so no declaration file generated?
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/compiler/b.js 0:4, but here has type 'number'.
@@ -16,10 +16,10 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(37,24): error TS2344: T
Type 'T' is not assignable to type '"visible"'.
Type 'string | number' is not assignable to type '"visible"'.
Type 'string' is not assignable to type '"visible"'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(59,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ [P in keyof T]?: T[P] | undefined; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(60,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ readonly [P in keyof T]: T[P]; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(61,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ readonly [P in keyof T]?: T[P] | undefined; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(66,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ [P in keyof T]: T[P][]; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(59,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ [P in keyof T]?: T[P] | undefined; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(60,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ readonly [P in keyof T]: T[P]; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(61,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ readonly [P in keyof T]?: T[P] | undefined; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(66,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 64:8, but here has type '{ [P in keyof T]: T[P][]; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(75,45): error TS2345: Argument of type '{ x: number; }' is not assignable to parameter of type 'Readonly<{ x: number; y: number; }>'.
Property 'y' is missing in type '{ x: number; }'.
tests/cases/conformance/types/mapped/mappedTypeErrors.ts(77,59): error TS2345: Argument of type '{ x: number; y: number; z: number; }' is not assignable to parameter of type 'Readonly<{ x: number; y: number; }>'.
@@ -138,20 +138,20 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(136,21): error TS2536:
var x: { [P in keyof T]: T[P] };
var x: { [P in keyof T]?: T[P] }; // Error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ [P in keyof T]?: T[P] | undefined; }'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ [P in keyof T]?: T[P] | undefined; }'.
var x: { readonly [P in keyof T]: T[P] }; // Error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ readonly [P in keyof T]: T[P]; }'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ readonly [P in keyof T]: T[P]; }'.
var x: { readonly [P in keyof T]?: T[P] }; // Error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ readonly [P in keyof T]?: T[P] | undefined; }'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 57:8, but here has type '{ readonly [P in keyof T]?: T[P] | undefined; }'.
}
function f12<T>() {
var x: { [P in keyof T]: T[P] };
var x: { [P in keyof T]: T[P][] }; // Error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type '{ [P in keyof T]: T[P]; }', but here has type '{ [P in keyof T]: T[P][]; }'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type '{ [P in keyof T]: T[P]; }' at tests/cases/conformance/types/mapped/mappedTypeErrors.ts 64:8, but here has type '{ [P in keyof T]: T[P][]; }'.
}
// Check that inferences to mapped types are secondary
@@ -1,6 +1,6 @@
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'.
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(15,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'T', but here has type 'number'.
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(39,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'T', but here has type 'number'.
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts 1:4, but here has type 'number'.
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(15,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'T' at tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts 10:8, but here has type 'number'.
tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts(39,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'T' at tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts 32:8, but here has type 'number'.
==== tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts (3 errors) ====
@@ -11,7 +11,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConfli
interface A {
x: number;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'string' at tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts 1:4, but here has type 'number'.
}
module M {
@@ -22,7 +22,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConfli
interface A<T> {
x: number; // error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'T', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'T' at tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts 10:8, but here has type 'number'.
}
}
@@ -48,6 +48,6 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConfli
export interface A<T> {
x: number; // error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'T', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'T' at tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts 32:8, but here has type 'number'.
}
}
@@ -1,11 +1,11 @@
tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(3,11): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(3,14): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(4,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'.
tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(4,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts 2:10, but here has type 'number'.
tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(4,18): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(5,11): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(5,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'any', but here has type 'number'.
tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(6,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'.
tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(6,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'any', but here has type 'number'.
tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(5,14): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'any' at tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts 2:13, but here has type 'number'.
tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(6,11): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts 2:10, but here has type 'number'.
tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(6,18): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'any' at tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts 2:13, but here has type 'number'.
tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(12,8): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(12,11): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(13,18): error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
@@ -30,19 +30,19 @@ tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(31,16):
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
var { x = 1, y } = {};
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts 2:10, but here has type 'number'.
~
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
var { x, y = 1 } = {};
~
!!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value.
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'any', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'any' at tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts 2:13, but here has type 'number'.
var { x = 1, y = 1 } = {};
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'any', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'any' at tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts 2:10, but here has type 'number'.
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'any', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'any' at tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts 2:13, but here has type 'number'.
}
// Missing properties
@@ -3,7 +3,7 @@ tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericString
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(12,5): error TS2300: Duplicate identifier '1'.
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(16,5): error TS2300: Duplicate identifier '1'.
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(17,5): error TS2300: Duplicate identifier '1'.
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(17,5): error TS2403: Subsequent variable declarations must have the same type. Variable '1.0' must be of type 'number', but here has type 'string'.
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(17,5): error TS2403: Subsequent variable declarations must have the same type. Variable '1.0' has type 'number' at tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts 15:4, but here has type 'string'.
tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts(22,5): error TS2300: Duplicate identifier '0'.
@@ -36,7 +36,7 @@ tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericString
~~~
!!! error TS2300: Duplicate identifier '1'.
~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable '1.0' must be of type 'number', but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable '1.0' has type 'number' at tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts 15:4, but here has type 'string'.
}
var b = {
@@ -1,4 +1,4 @@
tests/cases/compiler/optionalParamterAndVariableDeclaration2.ts(3,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'options' must be of type 'number | undefined', but here has type 'number'.
tests/cases/compiler/optionalParamterAndVariableDeclaration2.ts(3,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'options' has type 'number | undefined' at tests/cases/compiler/optionalParamterAndVariableDeclaration2.ts 1:16, but here has type 'number'.
==== tests/cases/compiler/optionalParamterAndVariableDeclaration2.ts (1 errors) ====
@@ -6,7 +6,7 @@ tests/cases/compiler/optionalParamterAndVariableDeclaration2.ts(3,13): error TS2
constructor(options?: number) {
var options = (options || 0);
~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'options' must be of type 'number | undefined', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'options' has type 'number | undefined' at tests/cases/compiler/optionalParamterAndVariableDeclaration2.ts 1:16, but here has type 'number'.
}
}
@@ -1,6 +1,6 @@
tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(19,5): error TS2345: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'.
Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'.
tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'w' must be of type 'A', but here has type 'C'.
tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'w' has type 'A' at tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts 20:4, but here has type 'C'.
tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,5): error TS2345: Argument of type '{ s: string; n: number; }' is not assignable to parameter of type '{ n: number; }'.
Object literal may only specify known properties, and 's' does not exist in type '{ n: number; }'.
@@ -32,7 +32,7 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,5): error TS234
var w: A;
var w: C;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'w' must be of type 'A', but here has type 'C'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'w' has type 'A' at tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts 20:4, but here has type 'C'.
w({ s: "", n: 0 }).toLowerCase();
~~~~~
@@ -6,7 +6,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(71,21):
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(84,5): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(85,11): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' has type 'number' at tests/cases/conformance/expressions/functionCalls/overloadResolution.ts 53:4, but here has type 'string'.
tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): error TS2339: Property 'toFixed' does not exist on type 'string'.
@@ -119,7 +119,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22):
function fn5() { return undefined; }
var n = fn5((n) => n.toFixed());
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'n' has type 'number' at tests/cases/conformance/expressions/functionCalls/overloadResolution.ts 53:4, but here has type 'string'.
~~~~~~~
!!! error TS2339: Property 'toFixed' does not exist on type 'string'.
var s = fn5((n) => n.substr(0));
@@ -6,7 +6,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(88,9): error TS2344: Type 'boolean' does not satisfy the constraint 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(91,9): error TS2345: Argument of type 'true' is not assignable to parameter of type 'number'.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(92,15): error TS2345: Argument of type 'true' is not assignable to parameter of type 'string'.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' has type 'number' at tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts 57:4, but here has type 'string'.
tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts(100,26): error TS2339: Property 'toFixed' does not exist on type 'string'.
@@ -128,7 +128,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors
var fn5: fn5;
var n = new fn5((n) => n.toFixed());
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'n' has type 'number' at tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts 57:4, but here has type 'string'.
~~~~~~~
!!! error TS2339: Property 'toFixed' does not exist on type 'string'.
var s = new fn5((n) => n.substr(0));
@@ -1,8 +1,8 @@
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(2,10): error TS2304: Cannot find name 'T'.
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(2,12): error TS2304: Cannot find name 'a'.
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(4,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'v' must be of type '<T>() => number', but here has type '<T>(a: any) => number'.
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'v' must be of type '<T>() => number', but here has type '<T>(a: any, b: any) => number'.
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'v' must be of type '<T>() => number', but here has type '<T>(a?: number, b?: number) => number'.
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(4,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'v' has type '<T>() => number' at tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts 0:4, but here has type '<T>(a: any) => number'.
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'v' has type '<T>() => number' at tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts 0:4, but here has type '<T>(a: any, b: any) => number'.
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'v' has type '<T>() => number' at tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts 0:4, but here has type '<T>(a?: number, b?: number) => number'.
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(8,10): error TS2304: Cannot find name 'T'.
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(8,13): error TS2304: Cannot find name 'a'.
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(9,10): error TS2304: Cannot find name 'T'.
@@ -24,13 +24,13 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunctio
var v = <T>(a) => 1;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'v' must be of type '<T>() => number', but here has type '<T>(a: any) => number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'v' has type '<T>() => number' at tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts 0:4, but here has type '<T>(a: any) => number'.
var v = <T>(a, b) => 1;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'v' must be of type '<T>() => number', but here has type '<T>(a: any, b: any) => number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'v' has type '<T>() => number' at tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts 0:4, but here has type '<T>(a: any, b: any) => number'.
var v = <T>(a = 1, b = 2) => 1;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'v' must be of type '<T>() => number', but here has type '<T>(a?: number, b?: number) => number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'v' has type '<T>() => number' at tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts 0:4, but here has type '<T>(a?: number, b?: number) => number'.
var v = <T>(a);
~
@@ -1,4 +1,4 @@
tests/cases/compiler/promiseIdentity2.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'IPromise<string, number>', but here has type 'Promise<any, string>'.
tests/cases/compiler/promiseIdentity2.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'IPromise<string, number>' at tests/cases/compiler/promiseIdentity2.ts 9:4, but here has type 'Promise<any, string>'.
==== tests/cases/compiler/promiseIdentity2.ts (1 errors) ====
@@ -14,4 +14,4 @@ tests/cases/compiler/promiseIdentity2.ts(11,5): error TS2403: Subsequent variabl
var x: IPromise<string, number>;
var x: Promise<any, string>;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'IPromise<string, number>', but here has type 'Promise<any, string>'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'IPromise<string, number>' at tests/cases/compiler/promiseIdentity2.ts 9:4, but here has type 'Promise<any, string>'.
@@ -1,5 +1,5 @@
tests/cases/compiler/promiseIdentityWithAny2.ts(10,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'IPromise<string, number>', but here has type 'Promise<string, boolean>'.
tests/cases/compiler/promiseIdentityWithAny2.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'IPromise2<string, number>', but here has type 'Promise2<string, boolean>'.
tests/cases/compiler/promiseIdentityWithAny2.ts(10,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'IPromise<string, number>' at tests/cases/compiler/promiseIdentityWithAny2.ts 8:4, but here has type 'Promise<string, boolean>'.
tests/cases/compiler/promiseIdentityWithAny2.ts(22,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'IPromise2<string, number>' at tests/cases/compiler/promiseIdentityWithAny2.ts 20:4, but here has type 'Promise2<string, boolean>'.
==== tests/cases/compiler/promiseIdentityWithAny2.ts (2 errors) ====
@@ -14,7 +14,7 @@ tests/cases/compiler/promiseIdentityWithAny2.ts(22,5): error TS2403: Subsequent
var x: IPromise<string, number>;
var x: Promise<string, boolean>;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'IPromise<string, number>', but here has type 'Promise<string, boolean>'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'IPromise<string, number>' at tests/cases/compiler/promiseIdentityWithAny2.ts 8:4, but here has type 'Promise<string, boolean>'.
interface IPromise2<T, V> {
@@ -28,4 +28,4 @@ tests/cases/compiler/promiseIdentityWithAny2.ts(22,5): error TS2403: Subsequent
var y: IPromise2<string, number>;
var y: Promise2<string, boolean>;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'IPromise2<string, number>', but here has type 'Promise2<string, boolean>'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'IPromise2<string, number>' at tests/cases/compiler/promiseIdentityWithAny2.ts 20:4, but here has type 'Promise2<string, boolean>'.
@@ -4,7 +4,7 @@ tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(45,14): err
tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(80,19): error TS2538: Type '{ name: string; }' cannot be used as an index type.
tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(117,18): error TS2538: Type '{ name: string; }' cannot be used as an index type.
tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(140,22): error TS2538: Type '{ name: string; }' cannot be used as an index type.
tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(149,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' must be of type 'A | B', but here has type 'A'.
tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(149,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' has type 'A | B' at tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts 147:4, but here has type 'A'.
==== tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts (6 errors) ====
@@ -169,5 +169,5 @@ tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(149,5): err
var x3 = bothIndex[stringOrNumber];
var x3: A;
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' must be of type 'A | B', but here has type 'A'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x3' has type 'A | B' at tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts 147:4, but here has type 'A'.
@@ -1,5 +1,5 @@
tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'Foo', but here has type 'Foo'.
tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts(13,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'Foo1', but here has type 'Foo2'.
tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'Foo' at tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts 3:4, but here has type 'Foo'.
tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts(13,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'Foo1' at tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts 11:4, but here has type 'Foo2'.
==== tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts (2 errors) ====
@@ -9,7 +9,7 @@ tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts(13,5): error TS240
var x: m1.Foo;
var x: m2.Foo; // Should be error (mod1.Foo !== mod2.Foo)
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'Foo', but here has type 'Foo'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'Foo' at tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts 3:4, but here has type 'Foo'.
class Foo1 {
private n;
}
@@ -19,7 +19,7 @@ tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts(13,5): error TS240
var y: Foo1;
var y: Foo2;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'Foo1', but here has type 'Foo2'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'Foo1' at tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts 11:4, but here has type 'Foo2'.
==== tests/cases/compiler/propertyIdentityWithPrivacyMismatch_0.ts (0 errors) ====
declare module 'mod1' {
class Foo {
@@ -1,5 +1,5 @@
tests/cases/compiler/reassignStaticProp.ts(5,12): error TS2300: Duplicate identifier 'bar'.
tests/cases/compiler/reassignStaticProp.ts(5,12): error TS2403: Subsequent variable declarations must have the same type. Variable 'bar' must be of type 'number', but here has type 'string'.
tests/cases/compiler/reassignStaticProp.ts(5,12): error TS2403: Subsequent variable declarations must have the same type. Variable 'bar' has type 'number' at tests/cases/compiler/reassignStaticProp.ts 2:11, but here has type 'string'.
==== tests/cases/compiler/reassignStaticProp.ts (2 errors) ====
@@ -11,7 +11,7 @@ tests/cases/compiler/reassignStaticProp.ts(5,12): error TS2403: Subsequent varia
~~~
!!! error TS2300: Duplicate identifier 'bar'.
~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'bar' must be of type 'number', but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'bar' has type 'number' at tests/cases/compiler/reassignStaticProp.ts 2:11, but here has type 'string'.
}
@@ -1,8 +1,8 @@
tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts(13,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r1' must be of type 'string', but here has type 'number'.
tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts(20,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r2' must be of type 'boolean', but here has type 'string'.
tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts(27,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r3' must be of type 'number', but here has type 'boolean'.
tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts(13,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r1' has type 'string' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts 9:8, but here has type 'number'.
tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts(20,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r2' has type 'boolean' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts 16:8, but here has type 'string'.
tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts(27,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r3' has type 'number' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts 23:8, but here has type 'boolean'.
tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts(30,5): error TS2365: Operator '==' cannot be applied to types '"string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"' and '"Object"'.
tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts(34,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'C', but here has type 'string'.
tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts(34,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'C' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts 30:8, but here has type 'string'.
==== tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts (5 errors) ====
@@ -20,7 +20,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHa
else {
var r1 = strOrNum; // string | number
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r1' must be of type 'string', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r1' has type 'string' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts 9:8, but here has type 'number'.
}
if (typeof strOrBool == "boolean") {
@@ -29,7 +29,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHa
else {
var r2 = strOrBool; // string | boolean
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r2' must be of type 'boolean', but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r2' has type 'boolean' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts 16:8, but here has type 'string'.
}
if (typeof numOrBool == "number") {
@@ -38,7 +38,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHa
else {
var r3 = numOrBool; // number | boolean
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r3' must be of type 'number', but here has type 'boolean'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r3' has type 'number' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts 23:8, but here has type 'boolean'.
}
if (typeof strOrC == "Object") {
@@ -49,5 +49,5 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHa
else {
var r4 = strOrC; // string | C
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'C', but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'C' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts 30:8, but here has type 'string'.
}
@@ -1,8 +1,8 @@
tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts(13,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r1' must be of type 'number', but here has type 'string'.
tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts(20,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r2' must be of type 'string', but here has type 'boolean'.
tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts(27,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r3' must be of type 'boolean', but here has type 'number'.
tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts(13,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r1' has type 'number' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts 9:8, but here has type 'string'.
tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts(20,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r2' has type 'string' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts 16:8, but here has type 'boolean'.
tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts(27,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r3' has type 'boolean' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts 23:8, but here has type 'number'.
tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts(30,5): error TS2365: Operator '!=' cannot be applied to types '"string" | "number" | "boolean" | "symbol" | "undefined" | "object" | "function"' and '"Object"'.
tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts(34,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'string', but here has type 'C'.
tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts(34,9): error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'string' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts 30:8, but here has type 'C'.
==== tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts (5 errors) ====
@@ -20,7 +20,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasN
else {
var r1 = strOrNum; // string | number
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r1' must be of type 'number', but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r1' has type 'number' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts 9:8, but here has type 'string'.
}
if (typeof strOrBool != "boolean") {
@@ -29,7 +29,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasN
else {
var r2 = strOrBool; // string | boolean
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r2' must be of type 'string', but here has type 'boolean'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r2' has type 'string' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts 16:8, but here has type 'boolean'.
}
if (typeof numOrBool != "number") {
@@ -38,7 +38,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasN
else {
var r3 = numOrBool; // number | boolean
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r3' must be of type 'boolean', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r3' has type 'boolean' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts 23:8, but here has type 'number'.
}
if (typeof strOrC != "Object") {
@@ -49,5 +49,5 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasN
else {
var r4 = strOrC; // string | C
~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'string', but here has type 'C'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' has type 'string' at tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts 30:8, but here has type 'C'.
}
@@ -1,5 +1,5 @@
tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'typeof E', but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'.
tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts(10,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'typeof E', but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'.
tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'typeof E' at tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts 6:4, but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'.
tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts(10,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'typeof E' at tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts 8:4, but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'.
tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts(10,70): error TS2375: Duplicate number index signature.
@@ -13,10 +13,10 @@ tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts(10,70): error TS2375: Dup
var x = E;
var x: { readonly a: E; readonly b: E; readonly [x: number]: string; }; // Shouldnt error
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'typeof E', but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'typeof E' at tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts 6:4, but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'.
var y = E;
var y: { readonly a: E; readonly b: E; readonly [x: number]: string; readonly [x: number]: string } // two errors: the types are not identical and duplicate signatures
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'typeof E', but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' has type 'typeof E' at tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts 8:4, but here has type '{ readonly [x: number]: string; readonly a: E; readonly b: E; }'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2375: Duplicate number index signature.
+20 -20
View File
@@ -1,19 +1,19 @@
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(14,13): error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type 'this', but here has type 'MyTestClass'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(18,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyTestClass'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(14,13): error TS2403: Subsequent variable declarations must have the same type. Variable 't' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 12:15, but here has type 'MyTestClass'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(18,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 16:12, but here has type 'MyTestClass'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(22,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(24,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyTestClass'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(24,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 22:12, but here has type 'MyTestClass'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(27,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(29,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyTestClass'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(37,13): error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type 'this', but here has type 'MyTestClass'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(29,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 27:12, but here has type 'MyTestClass'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(37,13): error TS2403: Subsequent variable declarations must have the same type. Variable 't' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 35:12, but here has type 'MyTestClass'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(53,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(61,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(83,13): error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type 'this', but here has type 'MyGenericTestClass<T, U>'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(87,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyGenericTestClass<T, U>'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(83,13): error TS2403: Subsequent variable declarations must have the same type. Variable 't' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 81:15, but here has type 'MyGenericTestClass<T, U>'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(87,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 85:12, but here has type 'MyGenericTestClass<T, U>'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(91,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(93,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyGenericTestClass<T, U>'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(93,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 91:12, but here has type 'MyGenericTestClass<T, U>'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(96,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(98,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyGenericTestClass<T, U>'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(106,13): error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type 'this', but here has type 'MyGenericTestClass<T, U>'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(98,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 96:12, but here has type 'MyGenericTestClass<T, U>'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(106,13): error TS2403: Subsequent variable declarations must have the same type. Variable 't' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 104:12, but here has type 'MyGenericTestClass<T, U>'.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(122,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(130,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
@@ -34,13 +34,13 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(130,16): error TS1
memberFunc(t = this) {
var t: MyTestClass;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type 'this', but here has type 'MyTestClass'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 12:15, but here has type 'MyTestClass'.
//type of 'this' in member function body is the class instance type
var p = this;
var p: MyTestClass;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyTestClass'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 16:12, but here has type 'MyTestClass'.
}
//type of 'this' in member accessor(get and set) body is the class instance type
@@ -50,7 +50,7 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(130,16): error TS1
var p = this;
var p: MyTestClass;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyTestClass'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 22:12, but here has type 'MyTestClass'.
return this;
}
set prop(v) {
@@ -59,7 +59,7 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(130,16): error TS1
var p = this;
var p: MyTestClass;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyTestClass'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 27:12, but here has type 'MyTestClass'.
p = v;
v = p;
}
@@ -69,7 +69,7 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(130,16): error TS1
var t = this;
var t: MyTestClass;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type 'this', but here has type 'MyTestClass'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 35:12, but here has type 'MyTestClass'.
};
//type of 'this' in static function param list is constructor function type
@@ -121,13 +121,13 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(130,16): error TS1
memberFunc(t = this) {
var t: MyGenericTestClass<T, U>;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type 'this', but here has type 'MyGenericTestClass<T, U>'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 81:15, but here has type 'MyGenericTestClass<T, U>'.
//type of 'this' in member function body is the class instance type
var p = this;
var p: MyGenericTestClass<T, U>;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyGenericTestClass<T, U>'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 85:12, but here has type 'MyGenericTestClass<T, U>'.
}
//type of 'this' in member accessor(get and set) body is the class instance type
@@ -137,7 +137,7 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(130,16): error TS1
var p = this;
var p: MyGenericTestClass<T, U>;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyGenericTestClass<T, U>'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 91:12, but here has type 'MyGenericTestClass<T, U>'.
return this;
}
set prop(v) {
@@ -146,7 +146,7 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(130,16): error TS1
var p = this;
var p: MyGenericTestClass<T, U>;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyGenericTestClass<T, U>'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 96:12, but here has type 'MyGenericTestClass<T, U>'.
p = v;
v = p;
}
@@ -156,7 +156,7 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(130,16): error TS1
var t = this;
var t: MyGenericTestClass<T, U>;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type 'this', but here has type 'MyGenericTestClass<T, U>'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' has type 'this' at tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts 104:12, but here has type 'MyGenericTestClass<T, U>'.
};
//type of 'this' in static function param list is constructor function type
@@ -1,4 +1,4 @@
tests/cases/conformance/types/union/unionTypeEquivalence.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'C', but here has type 'C | D'.
tests/cases/conformance/types/union/unionTypeEquivalence.ts(5,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'C' at tests/cases/conformance/types/union/unionTypeEquivalence.ts 3:4, but here has type 'C | D'.
==== tests/cases/conformance/types/union/unionTypeEquivalence.ts (1 errors) ====
@@ -8,7 +8,7 @@ tests/cases/conformance/types/union/unionTypeEquivalence.ts(5,5): error TS2403:
var x: C;
var x : C | D;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'C', but here has type 'C | D'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' has type 'C' at tests/cases/conformance/types/union/unionTypeEquivalence.ts 3:4, but here has type 'C | D'.
// A | B is equivalent to B | A.
var y: string | number;
@@ -1,6 +1,6 @@
tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' must be of type 'string | boolean', but here has type 'string'.
tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts(7,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' must be of type 'string | boolean', but here has type 'boolean'.
tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' must be of type 'string | boolean', but here has type 'number'.
tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts(6,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' has type 'string | boolean' at tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts 2:4, but here has type 'string'.
tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts(7,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' has type 'string | boolean' at tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts 2:4, but here has type 'boolean'.
tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts(8,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' has type 'string | boolean' at tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts 2:4, but here has type 'number'.
==== tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts (3 errors) ====
@@ -11,10 +11,10 @@ tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeI
var strOrNum: boolean | string | boolean;
var strOrNum: string; // error
~~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' must be of type 'string | boolean', but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' has type 'string | boolean' at tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts 2:4, but here has type 'string'.
var strOrNum: boolean; // error
~~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' must be of type 'string | boolean', but here has type 'boolean'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' has type 'string | boolean' at tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts 2:4, but here has type 'boolean'.
var strOrNum: number; // error
~~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' must be of type 'string | boolean', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' has type 'string | boolean' at tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts 2:4, but here has type 'number'.
@@ -1,5 +1,5 @@
tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'unionOfFunctionType' must be of type '(() => string) | (() => number)', but here has type '() => string | number'.
tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts(15,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'unionOfConstructorType' must be of type '(new () => string) | (new () => number)', but here has type 'new () => string | number'.
tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts(11,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'unionOfFunctionType' has type '(() => string) | (() => number)' at tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts 8:4, but here has type '() => string | number'.
tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts(15,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'unionOfConstructorType' has type '(new () => string) | (new () => number)' at tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts 12:4, but here has type 'new () => string | number'.
==== tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts (2 errors) ====
@@ -15,10 +15,10 @@ tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts(
var unionOfFunctionType: { (): string } | { (): number };
var unionOfFunctionType: () => string | number;
~~~~~~~~~~~~~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'unionOfFunctionType' must be of type '(() => string) | (() => number)', but here has type '() => string | number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'unionOfFunctionType' has type '(() => string) | (() => number)' at tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts 8:4, but here has type '() => string | number'.
var unionOfConstructorType: (new () => string) | (new () => number);
var unionOfConstructorType: { new (): string } | { new (): number };
var unionOfConstructorType: new () => string | number;
~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'unionOfConstructorType' must be of type '(new () => string) | (new () => number)', but here has type 'new () => string | number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'unionOfConstructorType' has type '(new () => string) | (new () => number)' at tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts 12:4, but here has type 'new () => string | number'.
@@ -16,7 +16,7 @@ tests/cases/compiler/varBlock.ts(33,25): error TS1039: Initializers are not allo
tests/cases/compiler/varBlock.ts(34,19): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(35,25): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(35,35): error TS1039: Initializers are not allowed in ambient contexts.
tests/cases/compiler/varBlock.ts(39,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'c' must be of type 'any', but here has type 'number'.
tests/cases/compiler/varBlock.ts(39,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'c' has type 'any' at tests/cases/compiler/varBlock.ts 37:12, but here has type 'number'.
tests/cases/compiler/varBlock.ts(39,15): error TS1039: Initializers are not allowed in ambient contexts.
@@ -97,6 +97,6 @@ tests/cases/compiler/varBlock.ts(39,15): error TS1039: Initializers are not allo
declare var c;
declare var c = 10;
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'c' must be of type 'any', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'c' has type 'any' at tests/cases/compiler/varBlock.ts 37:12, but here has type 'number'.
~
!!! error TS1039: Initializers are not allowed in ambient contexts.
+14 -14
View File
@@ -1,17 +1,17 @@
tests/cases/conformance/types/witness/witness.ts(4,21): error TS2372: Parameter 'pInit' cannot be referenced in its initializer.
tests/cases/conformance/types/witness/witness.ts(28,12): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/types/witness/witness.ts(29,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'co1' must be of type 'any', but here has type 'number'.
tests/cases/conformance/types/witness/witness.ts(29,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'co1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 27:4, but here has type 'number'.
tests/cases/conformance/types/witness/witness.ts(30,12): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/types/witness/witness.ts(30,12): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/types/witness/witness.ts(32,12): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/types/witness/witness.ts(32,12): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/types/witness/witness.ts(32,12): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/types/witness/witness.ts(33,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'co3' must be of type 'any', but here has type 'number'.
tests/cases/conformance/types/witness/witness.ts(37,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'as1' must be of type 'any', but here has type 'number'.
tests/cases/conformance/types/witness/witness.ts(39,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'as2' must be of type 'any', but here has type 'number'.
tests/cases/conformance/types/witness/witness.ts(43,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'cnd1' must be of type 'any', but here has type 'number'.
tests/cases/conformance/types/witness/witness.ts(57,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'and1' must be of type 'any', but here has type 'string'.
tests/cases/conformance/types/witness/witness.ts(110,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'propAcc1' must be of type 'any', but here has type '{ m: any; }'.
tests/cases/conformance/types/witness/witness.ts(33,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'co3' has type 'any' at tests/cases/conformance/types/witness/witness.ts 31:4, but here has type 'number'.
tests/cases/conformance/types/witness/witness.ts(37,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'as1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 35:4, but here has type 'number'.
tests/cases/conformance/types/witness/witness.ts(39,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'as2' has type 'any' at tests/cases/conformance/types/witness/witness.ts 37:4, but here has type 'number'.
tests/cases/conformance/types/witness/witness.ts(43,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'cnd1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 41:4, but here has type 'number'.
tests/cases/conformance/types/witness/witness.ts(57,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'and1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 55:4, but here has type 'string'.
tests/cases/conformance/types/witness/witness.ts(110,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'propAcc1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 106:4, but here has type '{ m: any; }'.
==== tests/cases/conformance/types/witness/witness.ts (14 errors) ====
@@ -49,7 +49,7 @@ tests/cases/conformance/types/witness/witness.ts(110,5): error TS2403: Subsequen
!!! error TS2695: Left side of comma operator is unused and has no side effects.
var co1: number;
~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'co1' must be of type 'any', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'co1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 27:4, but here has type 'number'.
var co2 = (3, 4, co2);
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
@@ -65,23 +65,23 @@ tests/cases/conformance/types/witness/witness.ts(110,5): error TS2403: Subsequen
!!! error TS2695: Left side of comma operator is unused and has no side effects.
var co3: number;
~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'co3' must be of type 'any', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'co3' has type 'any' at tests/cases/conformance/types/witness/witness.ts 31:4, but here has type 'number'.
// Assignment
var as1 = (as1 = 2);
var as1: number;
~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'as1' must be of type 'any', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'as1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 35:4, but here has type 'number'.
var as2 = (as2 = as2 = 2);
var as2: number;
~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'as2' must be of type 'any', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'as2' has type 'any' at tests/cases/conformance/types/witness/witness.ts 37:4, but here has type 'number'.
// Conditional
var cnd1 = cnd1 ? 0 : 1;
var cnd1: number;
~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'cnd1' must be of type 'any', but here has type 'number'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'cnd1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 41:4, but here has type 'number'.
var cnd2 = cnd1 ? cnd1 ? '' : "" : '';
var cnd2: string;
@@ -97,7 +97,7 @@ tests/cases/conformance/types/witness/witness.ts(110,5): error TS2403: Subsequen
var and1 = and1 && '';
var and1: string;
~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'and1' must be of type 'any', but here has type 'string'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'and1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 55:4, but here has type 'string'.
var and2 = '' && and2;
var and2: any;
var and3 = and3 && and3;
@@ -152,7 +152,7 @@ tests/cases/conformance/types/witness/witness.ts(110,5): error TS2403: Subsequen
};
var propAcc1: { m: any; }
~~~~~~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'propAcc1' must be of type 'any', but here has type '{ m: any; }'.
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'propAcc1' has type 'any' at tests/cases/conformance/types/witness/witness.ts 106:4, but here has type '{ m: any; }'.
// Property access of module member
module M2 {