diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index e9dddff64af39..9e5c864f6b975 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5352,7 +5352,7 @@ namespace ts { return type; } else if (declaredType !== errorType && type !== errorType && !isTypeIdenticalTo(declaredType, type)) { - errorNextVariableOrPropertyDeclarationMustHaveSameType(declaredType, declaration, type); + errorNextVariableOrPropertyDeclarationMustHaveSameType(/*firstDeclaration*/ undefined, declaredType, declaration, type); } } return declaredType; @@ -26839,7 +26839,7 @@ namespace ts { if (type !== errorType && declarationType !== errorType && !isTypeIdenticalTo(type, declarationType) && !(symbol.flags & SymbolFlags.Assignment)) { - errorNextVariableOrPropertyDeclarationMustHaveSameType(type, node, declarationType); + errorNextVariableOrPropertyDeclarationMustHaveSameType(symbol.valueDeclaration, type, node, declarationType); } if (node.initializer) { checkTypeAssignableToAndOptionallyElaborate(checkExpressionCached(node.initializer), declarationType, node, node.initializer, /*headMessage*/ undefined); @@ -26859,17 +26859,24 @@ namespace ts { } } - function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstType: Type, nextDeclaration: Declaration, nextType: Type): void { + function errorNextVariableOrPropertyDeclarationMustHaveSameType(firstDeclaration: Declaration | undefined, firstType: Type, nextDeclaration: Declaration, nextType: Type): void { const nextDeclarationName = getNameOfDeclaration(nextDeclaration); const message = nextDeclaration.kind === SyntaxKind.PropertyDeclaration || nextDeclaration.kind === SyntaxKind.PropertySignature ? Diagnostics.Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2 : Diagnostics.Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2; - error( + const declName = declarationNameToString(nextDeclarationName); + const err = error( nextDeclarationName, message, - declarationNameToString(nextDeclarationName), + declName, typeToString(firstType), - typeToString(nextType)); + typeToString(nextType) + ); + if (firstDeclaration) { + addRelatedInfo(err, + createDiagnosticForNode(firstDeclaration, Diagnostics._0_was_also_declared_here, declName) + ); + } } function areDeclarationFlagsIdentical(left: Declaration, right: Declaration) { diff --git a/tests/baselines/reference/ES5For-of7.errors.txt b/tests/baselines/reference/ES5For-of7.errors.txt index a3d40f3881416..460c7bf468091 100644 --- a/tests/baselines/reference/ES5For-of7.errors.txt +++ b/tests/baselines/reference/ES5For-of7.errors.txt @@ -10,4 +10,5 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts(6,9): error TS 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[]'. +!!! related TS6203 tests/cases/conformance/statements/for-ofStatements/ES5For-of7.ts:2:9: 'x' was also declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt index 20f8e09248ad2..0a72e6b641d6c 100644 --- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.errors.txt @@ -24,6 +24,7 @@ tests/cases/conformance/internalModules/DeclarationMerging/test.ts(2,5): error T 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'. +!!! related TS6203 tests/cases/conformance/internalModules/DeclarationMerging/test.ts:1:5: 'fn' was also declared here. var cl: { x: number; y: number; } var cl = A.Point(); @@ -46,6 +47,7 @@ tests/cases/conformance/internalModules/DeclarationMerging/test.ts(2,5): error T 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'. +!!! related TS6203 tests/cases/conformance/internalModules/DeclarationMerging/test.ts:1:5: 'fn' was also declared here. var cl: { x: number; y: number; } var cl = B.Point(); diff --git a/tests/baselines/reference/asyncArrowFunction5_es2017.errors.txt b/tests/baselines/reference/asyncArrowFunction5_es2017.errors.txt index 28ddb3bb9b95b..26601467324e6 100644 --- a/tests/baselines/reference/asyncArrowFunction5_es2017.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction5_es2017.errors.txt @@ -16,6 +16,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 'any'. +!!! related TS6203 /.ts/lib.es2015.promise.d.ts:152:13: 'Promise' was also declared here. ~ !!! error TS1005: ',' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction5_es5.errors.txt b/tests/baselines/reference/asyncArrowFunction5_es5.errors.txt index f132abff2355b..cf82d765a566a 100644 --- a/tests/baselines/reference/asyncArrowFunction5_es5.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction5_es5.errors.txt @@ -16,6 +16,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 'any'. +!!! related TS6203 /.ts/lib.es2015.promise.d.ts:152:13: 'Promise' was also declared here. ~ !!! error TS1005: ',' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt b/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt index a2f6f4412521c..909efc3c97eec 100644 --- a/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction5_es6.errors.txt @@ -16,6 +16,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 'any'. +!!! related TS6203 /.ts/lib.es2015.promise.d.ts:152:13: 'Promise' was also declared here. ~ !!! error TS1005: ',' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction9_es2017.errors.txt b/tests/baselines/reference/asyncArrowFunction9_es2017.errors.txt index cd2bb9c885820..0be88de28681a 100644 --- a/tests/baselines/reference/asyncArrowFunction9_es2017.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction9_es2017.errors.txt @@ -16,6 +16,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 'any'. +!!! related TS6203 /.ts/lib.es2015.promise.d.ts:152:13: 'Promise' was also declared here. ~ !!! error TS1005: ',' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction9_es5.errors.txt b/tests/baselines/reference/asyncArrowFunction9_es5.errors.txt index be561eab72c0f..085b3b50884b7 100644 --- a/tests/baselines/reference/asyncArrowFunction9_es5.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction9_es5.errors.txt @@ -16,6 +16,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 'any'. +!!! related TS6203 /.ts/lib.es2015.promise.d.ts:152:13: 'Promise' was also declared here. ~ !!! error TS1005: ',' expected. ~~ diff --git a/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt b/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt index 84177f28292d9..6949aad5cea0c 100644 --- a/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt +++ b/tests/baselines/reference/asyncArrowFunction9_es6.errors.txt @@ -16,6 +16,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 'any'. +!!! related TS6203 /.ts/lib.es2015.promise.d.ts:152:13: 'Promise' was also declared here. ~ !!! error TS1005: ',' expected. ~~ diff --git a/tests/baselines/reference/augmentedTypesVar.errors.txt b/tests/baselines/reference/augmentedTypesVar.errors.txt index 261686f365936..ae910b4f5be16 100644 --- a/tests/baselines/reference/augmentedTypesVar.errors.txt +++ b/tests/baselines/reference/augmentedTypesVar.errors.txt @@ -30,6 +30,7 @@ tests/cases/compiler/augmentedTypesVar.ts(31,8): error TS2300: Duplicate identif 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'. +!!! related TS6203 tests/cases/compiler/augmentedTypesVar.ts:9:5: 'x3' was also declared here. // var then class var x4 = 1; // error diff --git a/tests/baselines/reference/castingTuple.errors.txt b/tests/baselines/reference/castingTuple.errors.txt index 4ddb42ed2d91d..0a1d592e8b1cf 100644 --- a/tests/baselines/reference/castingTuple.errors.txt +++ b/tests/baselines/reference/castingTuple.errors.txt @@ -71,6 +71,7 @@ tests/cases/conformance/types/tuple/castingTuple.ts(33,1): error TS2304: Cannot var array1 = numStrTuple; ~~~~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'array1' must be of type '{}[]', but here has type 'number[]'. +!!! related TS6203 tests/cases/conformance/types/tuple/castingTuple.ts:23:5: 'array1' was also declared here. t4[2] = 10; ~~ !!! error TS2304: Cannot find name 't4'. diff --git a/tests/baselines/reference/checkMergedGlobalUMDSymbol.errors.txt b/tests/baselines/reference/checkMergedGlobalUMDSymbol.errors.txt index f3d21e26b6e67..f4b889131f17e 100644 --- a/tests/baselines/reference/checkMergedGlobalUMDSymbol.errors.txt +++ b/tests/baselines/reference/checkMergedGlobalUMDSymbol.errors.txt @@ -15,6 +15,7 @@ tests/cases/compiler/global.d.ts(6,16): error TS2403: Subsequent variable declar export const THREE: typeof _three; ~~~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'THREE' must be of type 'typeof import("tests/cases/compiler/global")', but here has type 'typeof import("tests/cases/compiler/three")'. +!!! related TS6203 tests/cases/compiler/global.d.ts:1:1: 'THREE' was also declared here. } ==== tests/cases/compiler/test.ts (0 errors) ==== diff --git a/tests/baselines/reference/classWithDuplicateIdentifier.errors.txt b/tests/baselines/reference/classWithDuplicateIdentifier.errors.txt index db48c48078cf7..60390e8a84354 100644 --- a/tests/baselines/reference/classWithDuplicateIdentifier.errors.txt +++ b/tests/baselines/reference/classWithDuplicateIdentifier.errors.txt @@ -14,6 +14,7 @@ tests/cases/compiler/classWithDuplicateIdentifier.ts(11,5): error TS2717: Subseq !!! error TS2300: Duplicate identifier 'a'. ~ !!! error TS2717: Subsequent property declarations must have the same type. Property 'a' must be of type '() => number', but here has type 'number'. +!!! related TS6203 tests/cases/compiler/classWithDuplicateIdentifier.ts:2:5: 'a' was also declared here. } class K { b: number; // error: duplicate identifier @@ -30,5 +31,6 @@ tests/cases/compiler/classWithDuplicateIdentifier.ts(11,5): error TS2717: Subseq !!! error TS2300: Duplicate identifier 'c'. ~ !!! error TS2717: Subsequent property declarations must have the same type. Property 'c' must be of type 'number', but here has type 'string'. +!!! related TS6203 tests/cases/compiler/classWithDuplicateIdentifier.ts:10:5: 'c' was also declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/conditionalTypes1.errors.txt b/tests/baselines/reference/conditionalTypes1.errors.txt index 7abcf55b8e7cb..45d3b1f99cb47 100644 --- a/tests/baselines/reference/conditionalTypes1.errors.txt +++ b/tests/baselines/reference/conditionalTypes1.errors.txt @@ -391,6 +391,7 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(288,43): error TS var z: T2; // Error, T2 is distributive, T1 isn't ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'T1', but here has type 'Foo'. +!!! related TS6203 tests/cases/conformance/types/conditional/conditionalTypes1.ts:262:9: 'z' was also declared here. } function f33() { diff --git a/tests/baselines/reference/declarationsAndAssignments.errors.txt b/tests/baselines/reference/declarationsAndAssignments.errors.txt index 312a0ed626c1b..b13aacbfbc3fe 100644 --- a/tests/baselines/reference/declarationsAndAssignments.errors.txt +++ b/tests/baselines/reference/declarationsAndAssignments.errors.txt @@ -97,6 +97,7 @@ tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts(138,9): var y: string; ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'string | number', but here has type 'string'. +!!! related TS6203 tests/cases/conformance/es6/destructuring/declarationsAndAssignments.ts:56:17: 'y' was also declared here. } function f8() { diff --git a/tests/baselines/reference/duplicateClassElements.errors.txt b/tests/baselines/reference/duplicateClassElements.errors.txt index 4ac9176776888..397ee4454590c 100644 --- a/tests/baselines/reference/duplicateClassElements.errors.txt +++ b/tests/baselines/reference/duplicateClassElements.errors.txt @@ -97,6 +97,7 @@ tests/cases/compiler/duplicateClassElements.ts(41,12): error TS2300: Duplicate i !!! error TS2300: Duplicate identifier 'x2'. ~~ !!! error TS2717: Subsequent property declarations must have the same type. Property 'x2' must be of type 'number', but here has type 'any'. +!!! related TS6203 tests/cases/compiler/duplicateClassElements.ts:29:9: 'x2' was also declared here. get z2() { ~~ diff --git a/tests/baselines/reference/duplicateIdentifierInCatchBlock.errors.txt b/tests/baselines/reference/duplicateIdentifierInCatchBlock.errors.txt index d8065df27c8a2..d2216efc6e653 100644 --- a/tests/baselines/reference/duplicateIdentifierInCatchBlock.errors.txt +++ b/tests/baselines/reference/duplicateIdentifierInCatchBlock.errors.txt @@ -38,4 +38,5 @@ tests/cases/compiler/duplicateIdentifierInCatchBlock.ts(16,9): error TS2403: Sub 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'. +!!! related TS6203 tests/cases/compiler/duplicateIdentifierInCatchBlock.ts:15:9: 'p' was also declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLocalVariable1.errors.txt b/tests/baselines/reference/duplicateLocalVariable1.errors.txt index 6f52156586203..a31ca844a868f 100644 --- a/tests/baselines/reference/duplicateLocalVariable1.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable1.errors.txt @@ -201,6 +201,7 @@ tests/cases/compiler/duplicateLocalVariable1.ts(186,37): error TS2356: An arithm 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'. +!!! related TS6203 tests/cases/compiler/duplicateLocalVariable1.ts:181:22: 'i' was also declared here. ~~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'string' and 'number'. ~ diff --git a/tests/baselines/reference/duplicateLocalVariable2.errors.txt b/tests/baselines/reference/duplicateLocalVariable2.errors.txt index 0258e7e846073..f25de4a704710 100644 --- a/tests/baselines/reference/duplicateLocalVariable2.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable2.errors.txt @@ -33,6 +33,7 @@ tests/cases/compiler/duplicateLocalVariable2.ts(27,37): error TS2356: An arithme 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'. +!!! related TS6203 tests/cases/compiler/duplicateLocalVariable2.ts:22:22: 'i' was also declared here. ~~~~~~ !!! error TS2365: Operator '<' cannot be applied to types 'string' and 'number'. ~ diff --git a/tests/baselines/reference/duplicateLocalVariable3.errors.txt b/tests/baselines/reference/duplicateLocalVariable3.errors.txt index 5dda5872da00f..2255776c75c2a 100644 --- a/tests/baselines/reference/duplicateLocalVariable3.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable3.errors.txt @@ -15,4 +15,5 @@ tests/cases/compiler/duplicateLocalVariable3.ts(11,9): error TS2403: Subsequent var z = ""; ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'z' must be of type 'number', but here has type 'string'. +!!! related TS6203 tests/cases/compiler/duplicateLocalVariable3.ts:10:9: 'z' was also declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/duplicateLocalVariable4.errors.txt b/tests/baselines/reference/duplicateLocalVariable4.errors.txt index 3209c23e39efb..67da21962b1e4 100644 --- a/tests/baselines/reference/duplicateLocalVariable4.errors.txt +++ b/tests/baselines/reference/duplicateLocalVariable4.errors.txt @@ -9,4 +9,5 @@ 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'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'typeof E', but here has type 'E'. +!!! related TS6203 tests/cases/compiler/duplicateLocalVariable4.ts:5:5: 'x' was also declared here. \ No newline at end of file diff --git a/tests/baselines/reference/duplicateVariablesWithAny.errors.txt b/tests/baselines/reference/duplicateVariablesWithAny.errors.txt index 787e118ca373c..0d71fde12e274 100644 --- a/tests/baselines/reference/duplicateVariablesWithAny.errors.txt +++ b/tests/baselines/reference/duplicateVariablesWithAny.errors.txt @@ -10,22 +10,26 @@ tests/cases/compiler/duplicateVariablesWithAny.ts(13,9): error TS2403: Subsequen 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'. +!!! related TS6203 tests/cases/compiler/duplicateVariablesWithAny.ts:2:5: 'x' was also declared here. 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'. +!!! related TS6203 tests/cases/compiler/duplicateVariablesWithAny.ts:5:5: 'y' was also declared here. 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'. +!!! related TS6203 tests/cases/compiler/duplicateVariablesWithAny.ts:9:9: 'x' was also declared here. 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'. +!!! related TS6203 tests/cases/compiler/duplicateVariablesWithAny.ts:12:9: 'y' was also declared here. } var z: any; diff --git a/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt b/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt index d422248321284..2f5e9f0963428 100644 --- a/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt +++ b/tests/baselines/reference/duplicateVarsAcrossFileBoundaries.errors.txt @@ -12,18 +12,22 @@ tests/cases/compiler/duplicateVarsAcrossFileBoundaries_2.ts(3,5): error TS2403: 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'. +!!! related TS6203 tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts:1:5: 'x' was also declared here. 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'. +!!! related TS6203 tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts:1:5: 'x' was also declared here. 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'. +!!! related TS6203 tests/cases/compiler/duplicateVarsAcrossFileBoundaries_0.ts:2:5: 'y' was also declared here. 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'. +!!! related TS6203 tests/cases/compiler/duplicateVarsAcrossFileBoundaries_1.ts:2:5: 'z' was also declared here. ==== tests/cases/compiler/duplicateVarsAcrossFileBoundaries_3.ts (0 errors) ==== var x = 0; diff --git a/tests/baselines/reference/dynamicNamesErrors.errors.txt b/tests/baselines/reference/dynamicNamesErrors.errors.txt index c39140dbd5257..43ca55db4ea83 100644 --- a/tests/baselines/reference/dynamicNamesErrors.errors.txt +++ b/tests/baselines/reference/dynamicNamesErrors.errors.txt @@ -35,6 +35,7 @@ tests/cases/compiler/dynamicNamesErrors.ts(25,1): error TS2322: Type 'T1' is not [c1]: string; ~~~~ !!! error TS2717: Subsequent property declarations must have the same type. Property '[c1]' must be of type 'number', but here has type 'string'. +!!! related TS6203 tests/cases/compiler/dynamicNamesErrors.ts:18:5: '[c1]' was also declared here. } let t1: T1; diff --git a/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt b/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt index e7c1297e1fd41..e76c053a0af36 100644 --- a/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt +++ b/tests/baselines/reference/enumAssignabilityInInheritance.errors.txt @@ -109,10 +109,12 @@ 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'. +!!! related TS6203 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts:22:5: 'r4' was also declared here. 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'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'r4' must be of type 'E', but here has type 'Object'. +!!! related TS6203 tests/cases/conformance/types/typeRelationships/assignmentCompatibility/enumAssignabilityInInheritance.ts:22:5: 'r4' was also declared here. \ No newline at end of file diff --git a/tests/baselines/reference/for-inStatements.errors.txt b/tests/baselines/reference/for-inStatements.errors.txt index 50f31d669cd41..03e11ff11157b 100644 --- a/tests/baselines/reference/for-inStatements.errors.txt +++ b/tests/baselines/reference/for-inStatements.errors.txt @@ -39,6 +39,7 @@ tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(79,15): 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 'Extract'. +!!! related TS6203 tests/cases/conformance/statements/for-inStatements/for-inStatements.ts:31:18: 'x' was also declared here. return null; } @@ -58,6 +59,7 @@ tests/cases/conformance/statements/for-inStatements/for-inStatements.ts(79,15): 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 'Extract'. +!!! related TS6203 tests/cases/conformance/statements/for-inStatements/for-inStatements.ts:48:18: 'x' was also declared here. for (var x in super.biz) { } for (var x in super.biz()) { } diff --git a/tests/baselines/reference/for-inStatementsArrayErrors.errors.txt b/tests/baselines/reference/for-inStatementsArrayErrors.errors.txt index 3ba7a73367f8a..2eb08a8b1f3d2 100644 --- a/tests/baselines/reference/for-inStatementsArrayErrors.errors.txt +++ b/tests/baselines/reference/for-inStatementsArrayErrors.errors.txt @@ -29,11 +29,13 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors. 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'. +!!! related TS6203 tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts:11:5: 'i' was also declared here. } 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'. +!!! related TS6203 tests/cases/conformance/statements/for-inStatements/for-inStatementsArrayErrors.ts:15:5: 'j' was also declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/for-inStatementsInvalid.errors.txt b/tests/baselines/reference/for-inStatementsInvalid.errors.txt index 8e1bb29d0834a..e8e29b37c4eba 100644 --- a/tests/baselines/reference/for-inStatementsInvalid.errors.txt +++ b/tests/baselines/reference/for-inStatementsInvalid.errors.txt @@ -73,6 +73,7 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(6 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 'Extract'. +!!! related TS6203 tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts:29:18: 'x' was also declared here. return null; } @@ -96,6 +97,7 @@ tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts(6 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 'Extract'. +!!! related TS6203 tests/cases/conformance/statements/for-inStatements/for-inStatementsInvalid.ts:46:18: 'x' was also declared here. for (var x in super.biz) { } for (var x in super.biz()) { } diff --git a/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt b/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt index 53ecb88363df4..f0de0ce954bac 100644 --- a/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt +++ b/tests/baselines/reference/forStatementsMultipleInvalidDecl.errors.txt @@ -47,46 +47,58 @@ tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDec 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'. +!!! related TS6203 tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts:31:10: 'a' was also declared here. 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'. +!!! related TS6203 tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts:31:10: 'a' was also declared here. 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'. +!!! related TS6203 tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts:31:10: 'a' was also declared here. for( var a = new D();;){} ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D'. +!!! related TS6203 tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts:31:10: 'a' was also declared here. 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'. +!!! related TS6203 tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts:31:10: 'a' was also declared here. 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'. +!!! related TS6203 tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts:38:10: 'b' was also declared here. 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'. +!!! related TS6203 tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts:38:10: 'b' was also declared here. 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'. +!!! related TS6203 tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts:42:9: 'f' was also declared here. 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[]'. +!!! related TS6203 tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts:45:9: 'arr' was also declared here. for( var arr = [new C(), new C2(), new D()];;){} ~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '(C | D)[]'. +!!! related TS6203 tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts:45:9: 'arr' was also declared here. for(var arr2 = [new D()];;){} for( var arr2 = new Array>();;){} ~~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D[]', but here has type 'D[]'. +!!! related TS6203 tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts:49:9: 'arr2' was also declared here. 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'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'. +!!! related TS6203 tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts:52:9: 'm' was also declared here. \ No newline at end of file diff --git a/tests/baselines/reference/functionArgShadowing.errors.txt b/tests/baselines/reference/functionArgShadowing.errors.txt index 930221784526e..c3ba60a80cdfa 100644 --- a/tests/baselines/reference/functionArgShadowing.errors.txt +++ b/tests/baselines/reference/functionArgShadowing.errors.txt @@ -10,6 +10,7 @@ tests/cases/compiler/functionArgShadowing.ts(10,7): error TS2403: Subsequent var 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'. +!!! related TS6203 tests/cases/compiler/functionArgShadowing.ts:3:14: 'x' was also declared here. x.bar(); // the property bar does not exist on a value of type A ~~~ !!! error TS2339: Property 'bar' does not exist on type 'A'. @@ -20,6 +21,7 @@ tests/cases/compiler/functionArgShadowing.ts(10,7): error TS2403: Subsequent var 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'. +!!! related TS6203 tests/cases/compiler/functionArgShadowing.ts:9:14: 'p' was also declared here. var n: number = p; } diff --git a/tests/baselines/reference/gettersAndSettersErrors.errors.txt b/tests/baselines/reference/gettersAndSettersErrors.errors.txt index e2a4bb3a146b8..013e195876e86 100644 --- a/tests/baselines/reference/gettersAndSettersErrors.errors.txt +++ b/tests/baselines/reference/gettersAndSettersErrors.errors.txt @@ -24,6 +24,7 @@ tests/cases/compiler/gettersAndSettersErrors.ts(12,16): error TS2379: Getter and !!! error TS2300: Duplicate identifier 'Foo'. ~~~ !!! error TS2717: Subsequent property declarations must have the same type. Property 'Foo' must be of type 'string', but here has type 'number'. +!!! related TS6203 tests/cases/compiler/gettersAndSettersErrors.ts:2:16: 'Foo' was also declared here. 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. diff --git a/tests/baselines/reference/identityForSignaturesWithTypeParametersAndAny.errors.txt b/tests/baselines/reference/identityForSignaturesWithTypeParametersAndAny.errors.txt index 6023928022699..092bfaaeeb3c9 100644 --- a/tests/baselines/reference/identityForSignaturesWithTypeParametersAndAny.errors.txt +++ b/tests/baselines/reference/identityForSignaturesWithTypeParametersAndAny.errors.txt @@ -12,18 +12,22 @@ tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(14,5): err var g: (x: any, y: any) => any; ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'g' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => any'. +!!! related TS6203 tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts:4:5: 'g' was also declared here. var h: (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 '(x: T, y: U) => T', but here has type '(x: any, y: any) => any'. +!!! related TS6203 tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts:7:5: 'h' was also declared here. var i: (x: T, y: U) => T; var i: (x: any, y: string) => any; ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: string) => any'. +!!! related TS6203 tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts:10:5: 'i' was also declared here. var j: (x: T, y: U) => T; var j: (x: any, y: any) => string; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => string'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'j' must be of type '(x: T, y: U) => T', but here has type '(x: any, y: any) => string'. +!!! related TS6203 tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts:13:5: 'j' was also declared here. \ No newline at end of file diff --git a/tests/baselines/reference/interfaceDeclaration1.errors.txt b/tests/baselines/reference/interfaceDeclaration1.errors.txt index 64410b44c551a..b4c41ca350ee5 100644 --- a/tests/baselines/reference/interfaceDeclaration1.errors.txt +++ b/tests/baselines/reference/interfaceDeclaration1.errors.txt @@ -30,6 +30,7 @@ tests/cases/compiler/interfaceDeclaration1.ts(52,11): error TS2320: Interface 'i !!! error TS2300: Duplicate identifier 'item'. ~~~~ !!! error TS2717: Subsequent property declarations must have the same type. Property 'item' must be of type 'any', but here has type 'number'. +!!! related TS6203 tests/cases/compiler/interfaceDeclaration1.ts:7:5: 'item' was also declared here. } interface I3 { diff --git a/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt b/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt index 3ec718f3b25fe..a43b9b0c27184 100644 --- a/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt +++ b/tests/baselines/reference/invalidMultipleVariableDeclarations.errors.txt @@ -47,46 +47,58 @@ tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDec 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'. +!!! related TS6203 tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts:31:5: 'a' was also declared here. 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'. +!!! related TS6203 tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts:31:5: 'a' was also declared here. 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'. +!!! related TS6203 tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts:31:5: 'a' was also declared here. var a = new D(); ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D'. +!!! related TS6203 tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts:31:5: 'a' was also declared here. 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'. +!!! related TS6203 tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts:31:5: 'a' was also declared here. 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'. +!!! related TS6203 tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts:38:5: 'b' was also declared here. 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'. +!!! related TS6203 tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts:38:5: 'b' was also declared here. 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'. +!!! related TS6203 tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts:42:5: 'f' was also declared here. 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[]'. +!!! related TS6203 tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts:45:5: 'arr' was also declared here. var arr = [new C(), new C2(), new D()]; ~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr' must be of type 'string[]', but here has type '(C | D)[]'. +!!! related TS6203 tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts:45:5: 'arr' was also declared here. var arr2 = [new D()]; var arr2 = new Array>(); ~~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'arr2' must be of type 'D[]', but here has type 'D[]'. +!!! related TS6203 tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts:49:5: 'arr2' was also declared here. 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'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'm' must be of type 'typeof M', but here has type 'typeof A'. +!!! related TS6203 tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts:52:5: 'm' was also declared here. \ No newline at end of file diff --git a/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt b/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt index f1374d957673f..9e46d6225a2c8 100644 --- a/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt +++ b/tests/baselines/reference/jsFileCompilationDuplicateVariableErrorReported.errors.txt @@ -9,4 +9,5 @@ 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'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'string', but here has type 'number'. +!!! related TS6203 tests/cases/compiler/b.js:1:5: 'x' was also declared here. \ No newline at end of file diff --git a/tests/baselines/reference/mappedTypeErrors.errors.txt b/tests/baselines/reference/mappedTypeErrors.errors.txt index 254d1cca1a89a..0dc68732e81a2 100644 --- a/tests/baselines/reference/mappedTypeErrors.errors.txt +++ b/tests/baselines/reference/mappedTypeErrors.errors.txt @@ -133,12 +133,15 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339: 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; }'. +!!! related TS6203 tests/cases/conformance/types/mapped/mappedTypeErrors.ts:58:9: 'x' was also declared here. 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]; }'. +!!! related TS6203 tests/cases/conformance/types/mapped/mappedTypeErrors.ts:58:9: 'x' was also declared here. 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; }'. +!!! related TS6203 tests/cases/conformance/types/mapped/mappedTypeErrors.ts:58:9: 'x' was also declared here. } function f12() { @@ -146,6 +149,7 @@ tests/cases/conformance/types/mapped/mappedTypeErrors.ts(152,17): error TS2339: 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][]; }'. +!!! related TS6203 tests/cases/conformance/types/mapped/mappedTypeErrors.ts:65:9: 'x' was also declared here. } // Check that inferences to mapped types are secondary diff --git a/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt index 523cad05465d4..6bb0e02f4eb66 100644 --- a/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt +++ b/tests/baselines/reference/mergedInterfacesWithConflictingPropertyNames.errors.txt @@ -12,6 +12,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConfli x: number; ~ !!! error TS2717: Subsequent property declarations must have the same type. Property 'x' must be of type 'string', but here has type 'number'. +!!! related TS6203 tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts:2:5: 'x' was also declared here. } module M { @@ -23,6 +24,7 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConfli x: number; // error ~ !!! error TS2717: Subsequent property declarations must have the same type. Property 'x' must be of type 'T', but here has type 'number'. +!!! related TS6203 tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts:11:9: 'x' was also declared here. } } @@ -49,5 +51,6 @@ tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConfli x: number; // error ~ !!! error TS2717: Subsequent property declarations must have the same type. Property 'x' must be of type 'T', but here has type 'number'. +!!! related TS6203 tests/cases/conformance/interfaces/declarationMerging/mergedInterfacesWithConflictingPropertyNames.ts:33:9: 'x' was also declared here. } } \ No newline at end of file diff --git a/tests/baselines/reference/methodSignatureHandledDeclarationKindForSymbol.errors.txt b/tests/baselines/reference/methodSignatureHandledDeclarationKindForSymbol.errors.txt index 99fd038bbb9e9..edb66f56dd347 100644 --- a/tests/baselines/reference/methodSignatureHandledDeclarationKindForSymbol.errors.txt +++ b/tests/baselines/reference/methodSignatureHandledDeclarationKindForSymbol.errors.txt @@ -10,6 +10,7 @@ tests/cases/compiler/methodSignatureHandledDeclarationKindForSymbol.ts(6,5): err bold: string; ~~~~ !!! error TS2717: Subsequent property declarations must have the same type. Property 'bold' must be of type '() => string', but here has type 'string'. +!!! related TS6203 tests/cases/compiler/methodSignatureHandledDeclarationKindForSymbol.ts:2:5: 'bold' was also declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/missingAndExcessProperties.errors.txt b/tests/baselines/reference/missingAndExcessProperties.errors.txt index 0ee69d9af306c..7972d770320e6 100644 --- a/tests/baselines/reference/missingAndExcessProperties.errors.txt +++ b/tests/baselines/reference/missingAndExcessProperties.errors.txt @@ -31,6 +31,7 @@ tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts(31,16): 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'. +!!! related TS6203 tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts:3:11: 'x' was also declared here. ~ !!! error TS2525: Initializer provides no value for this binding element and the binding element has no default value. var { x, y = 1 } = {}; @@ -38,11 +39,14 @@ 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. ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'any', but here has type 'number'. +!!! related TS6203 tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts:3:14: 'y' was also declared here. 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'. +!!! related TS6203 tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts:3:11: 'x' was also declared here. ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'any', but here has type 'number'. +!!! related TS6203 tests/cases/conformance/es6/destructuring/missingAndExcessProperties.ts:3:14: 'y' was also declared here. } // Missing properties diff --git a/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt b/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt index 105a1af9efe0b..0792565f063ed 100644 --- a/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt +++ b/tests/baselines/reference/negateOperatorInvalidOperations.errors.txt @@ -44,5 +44,6 @@ tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperator var NUMBER =-; ~~~~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'NUMBER' must be of type 'any', but here has type 'number'. +!!! related TS6203 tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorInvalidOperations.ts:4:19: 'NUMBER' was also declared here. ~ !!! error TS1109: Expression expected. \ No newline at end of file diff --git a/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt b/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt index 8f0a27e03d97d..7d3ff163300d5 100644 --- a/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt +++ b/tests/baselines/reference/numericStringNamedPropertyEquivalence.errors.txt @@ -37,6 +37,7 @@ tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericString !!! error TS2300: Duplicate identifier '1'. ~~~ !!! error TS2717: Subsequent property declarations must have the same type. Property '1.0' must be of type 'number', but here has type 'string'. +!!! related TS6203 tests/cases/conformance/types/objectTypeLiteral/propertySignatures/numericStringNamedPropertyEquivalence.ts:16:5: '1.0' was also declared here. } var b = { diff --git a/tests/baselines/reference/objectLiteralContextualTyping.errors.txt b/tests/baselines/reference/objectLiteralContextualTyping.errors.txt index b73b7b43a89c9..2ff2a7287f8f9 100644 --- a/tests/baselines/reference/objectLiteralContextualTyping.errors.txt +++ b/tests/baselines/reference/objectLiteralContextualTyping.errors.txt @@ -33,4 +33,5 @@ tests/cases/conformance/expressions/contextualTyping/objectLiteralContextualTypi var b: {}; ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'b' must be of type 'unknown', but here has type '{}'. +!!! related TS6203 tests/cases/conformance/expressions/contextualTyping/objectLiteralContextualTyping.ts:28:5: 'b' was also declared here. \ No newline at end of file diff --git a/tests/baselines/reference/objectRest.errors.txt b/tests/baselines/reference/objectRest.errors.txt index 02f64fbd4e21b..f6fd179d28d3a 100644 --- a/tests/baselines/reference/objectRest.errors.txt +++ b/tests/baselines/reference/objectRest.errors.txt @@ -62,6 +62,7 @@ tests/cases/conformance/types/rest/objectRest.ts(44,53): error TS2739: Type '{}' !!! error TS2537: Type '{ a: number; b: string; }' has no matching index signature for type 'string'. ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o' must be of type '{ a: number; b: string; }', but here has type '{}'. +!!! related TS6203 tests/cases/conformance/types/rest/objectRest.ts:1:5: 'o' was also declared here. ({ [computed]: stillNotGreat, [computed2]: soSo, ...o } = o); ~~~~~~~~ !!! error TS2537: Type '{ a: number; b: string; }' has no matching index signature for type 'string'. diff --git a/tests/baselines/reference/optionalParamterAndVariableDeclaration2.errors.txt b/tests/baselines/reference/optionalParamterAndVariableDeclaration2.errors.txt index 982318d2f2548..df38f7d20515b 100644 --- a/tests/baselines/reference/optionalParamterAndVariableDeclaration2.errors.txt +++ b/tests/baselines/reference/optionalParamterAndVariableDeclaration2.errors.txt @@ -7,6 +7,7 @@ tests/cases/compiler/optionalParamterAndVariableDeclaration2.ts(3,13): error TS2 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'. +!!! related TS6203 tests/cases/compiler/optionalParamterAndVariableDeclaration2.ts:2:17: 'options' was also declared here. } } \ No newline at end of file diff --git a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt index f108f0ea92da0..fc8d68f1af8ee 100644 --- a/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt +++ b/tests/baselines/reference/orderMattersForSignatureGroupIdentity.errors.txt @@ -33,6 +33,7 @@ tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts(24,5): error TS234 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'. +!!! related TS6203 tests/cases/compiler/orderMattersForSignatureGroupIdentity.ts:21:5: 'w' was also declared here. w({ s: "", n: 0 }).toLowerCase(); ~~~~~ diff --git a/tests/baselines/reference/overloadResolution.errors.txt b/tests/baselines/reference/overloadResolution.errors.txt index 27d0392ca8dbc..fde241d62cc51 100644 --- a/tests/baselines/reference/overloadResolution.errors.txt +++ b/tests/baselines/reference/overloadResolution.errors.txt @@ -120,6 +120,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolution.ts(91,22): 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'. +!!! related TS6203 tests/cases/conformance/expressions/functionCalls/overloadResolution.ts:54:5: 'n' was also declared here. ~~~~~~~ !!! error TS2339: Property 'toFixed' does not exist on type 'string'. var s = fn5((n) => n.substr(0)); diff --git a/tests/baselines/reference/overloadResolutionConstructors.errors.txt b/tests/baselines/reference/overloadResolutionConstructors.errors.txt index 2e09a84d13818..40b660c7eafab 100644 --- a/tests/baselines/reference/overloadResolutionConstructors.errors.txt +++ b/tests/baselines/reference/overloadResolutionConstructors.errors.txt @@ -129,6 +129,7 @@ tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors 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'. +!!! related TS6203 tests/cases/conformance/expressions/functionCalls/overloadResolutionConstructors.ts:58:5: 'n' was also declared here. ~~~~~~~ !!! error TS2339: Property 'toFixed' does not exist on type 'string'. var s = new fn5((n) => n.substr(0)); diff --git a/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt b/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt index e2d90538b8c49..9a34f75ce401c 100644 --- a/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt +++ b/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt @@ -25,12 +25,15 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunctio var v = (a) => 1; ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'v' must be of type '() => number', but here has type '(a: any) => number'. +!!! related TS6203 tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts:1:5: 'v' was also declared here. var v = (a, b) => 1; ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'v' must be of type '() => number', but here has type '(a: any, b: any) => number'. +!!! related TS6203 tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts:1:5: 'v' was also declared here. var v = (a = 1, b = 2) => 1; ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'v' must be of type '() => number', but here has type '(a?: number, b?: number) => number'. +!!! related TS6203 tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts:1:5: 'v' was also declared here. var v = (a); ~ diff --git a/tests/baselines/reference/promiseIdentity2.errors.txt b/tests/baselines/reference/promiseIdentity2.errors.txt index edfba2f42bcd4..0b5ba8d0ff0d9 100644 --- a/tests/baselines/reference/promiseIdentity2.errors.txt +++ b/tests/baselines/reference/promiseIdentity2.errors.txt @@ -14,4 +14,5 @@ tests/cases/compiler/promiseIdentity2.ts(11,5): error TS2403: Subsequent variabl var x: IPromise; var x: Promise; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'IPromise', but here has type 'Promise'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'IPromise', but here has type 'Promise'. +!!! related TS6203 tests/cases/compiler/promiseIdentity2.ts:10:5: 'x' was also declared here. \ No newline at end of file diff --git a/tests/baselines/reference/promiseIdentityWithAny2.errors.txt b/tests/baselines/reference/promiseIdentityWithAny2.errors.txt index 9d01438b88c49..bedb948b078f2 100644 --- a/tests/baselines/reference/promiseIdentityWithAny2.errors.txt +++ b/tests/baselines/reference/promiseIdentityWithAny2.errors.txt @@ -15,6 +15,7 @@ tests/cases/compiler/promiseIdentityWithAny2.ts(22,5): error TS2403: Subsequent var x: Promise; ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'x' must be of type 'IPromise', but here has type 'Promise'. +!!! related TS6203 tests/cases/compiler/promiseIdentityWithAny2.ts:9:5: 'x' was also declared here. interface IPromise2 { @@ -28,4 +29,5 @@ tests/cases/compiler/promiseIdentityWithAny2.ts(22,5): error TS2403: Subsequent var y: IPromise2; var y: Promise2; ~ -!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'IPromise2', but here has type 'Promise2'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'y' must be of type 'IPromise2', but here has type 'Promise2'. +!!! related TS6203 tests/cases/compiler/promiseIdentityWithAny2.ts:21:5: 'y' was also declared here. \ No newline at end of file diff --git a/tests/baselines/reference/propertyAccess.errors.txt b/tests/baselines/reference/propertyAccess.errors.txt index a183ad79c1129..1351a46e099f4 100644 --- a/tests/baselines/reference/propertyAccess.errors.txt +++ b/tests/baselines/reference/propertyAccess.errors.txt @@ -170,4 +170,5 @@ tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts(149,5): err 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'. +!!! related TS6203 tests/cases/conformance/expressions/propertyAccess/propertyAccess.ts:148:5: 'x3' was also declared here. \ No newline at end of file diff --git a/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.errors.txt b/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.errors.txt index 4c5644f6b767d..f2ac54f6e7c1c 100644 --- a/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.errors.txt +++ b/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.errors.txt @@ -10,6 +10,7 @@ tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts(13,5): error TS240 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'. +!!! related TS6203 tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts:4:5: 'x' was also declared here. class Foo1 { private n; } @@ -20,6 +21,7 @@ tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts(13,5): error TS240 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'. +!!! related TS6203 tests/cases/compiler/propertyIdentityWithPrivacyMismatch_1.ts:12:5: 'y' was also declared here. ==== tests/cases/compiler/propertyIdentityWithPrivacyMismatch_0.ts (0 errors) ==== declare module 'mod1' { class Foo { diff --git a/tests/baselines/reference/reassignStaticProp.errors.txt b/tests/baselines/reference/reassignStaticProp.errors.txt index b1bfb869d6889..bd62f1aa80dfb 100644 --- a/tests/baselines/reference/reassignStaticProp.errors.txt +++ b/tests/baselines/reference/reassignStaticProp.errors.txt @@ -12,6 +12,7 @@ tests/cases/compiler/reassignStaticProp.ts(5,12): error TS2717: Subsequent prope !!! error TS2300: Duplicate identifier 'bar'. ~~~ !!! error TS2717: Subsequent property declarations must have the same type. Property 'bar' must be of type 'number', but here has type 'string'. +!!! related TS6203 tests/cases/compiler/reassignStaticProp.ts:3:12: 'bar' was also declared here. } diff --git a/tests/baselines/reference/spreadUnion2.errors.txt b/tests/baselines/reference/spreadUnion2.errors.txt index 0115c4499301b..f2c1bc757783e 100644 --- a/tests/baselines/reference/spreadUnion2.errors.txt +++ b/tests/baselines/reference/spreadUnion2.errors.txt @@ -14,28 +14,34 @@ tests/cases/conformance/types/spread/spreadUnion2.ts(18,5): error TS2403: Subseq var o1 = { ...undefinedUnion }; ~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o1' must be of type '{} | { a: number; }', but here has type '{}'. +!!! related TS6203 tests/cases/conformance/types/spread/spreadUnion2.ts:4:5: 'o1' was also declared here. var o2: {} | { b: number }; var o2 = { ...nullUnion }; ~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o2' must be of type '{} | { b: number; }', but here has type '{}'. +!!! related TS6203 tests/cases/conformance/types/spread/spreadUnion2.ts:7:5: 'o2' was also declared here. var o3: {} | { a: number } | { b: number } | { a: number, b: number }; var o3 = { ...undefinedUnion, ...nullUnion }; ~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o3' must be of type '{} | { a: number; } | { b: number; } | { a: number; b: number; }', but here has type '{}'. +!!! related TS6203 tests/cases/conformance/types/spread/spreadUnion2.ts:10:5: 'o3' was also declared here. var o3 = { ...nullUnion, ...undefinedUnion }; ~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o3' must be of type '{} | { a: number; } | { b: number; } | { a: number; b: number; }', but here has type '{}'. +!!! related TS6203 tests/cases/conformance/types/spread/spreadUnion2.ts:10:5: 'o3' was also declared here. var o4: {} | { a: number }; var o4 = { ...undefinedUnion, ...undefinedUnion }; ~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o4' must be of type '{} | { a: number; }', but here has type '{}'. +!!! related TS6203 tests/cases/conformance/types/spread/spreadUnion2.ts:14:5: 'o4' was also declared here. var o5: {} | { b: number }; var o5 = { ...nullUnion, ...nullUnion }; ~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'o5' must be of type '{} | { b: number; }', but here has type '{}'. +!!! related TS6203 tests/cases/conformance/types/spread/spreadUnion2.ts:17:5: 'o5' was also declared here. \ No newline at end of file diff --git a/tests/baselines/reference/strictTupleLength.errors.txt b/tests/baselines/reference/strictTupleLength.errors.txt index 933c6e4dcdb20..78cf7b47e97ae 100644 --- a/tests/baselines/reference/strictTupleLength.errors.txt +++ b/tests/baselines/reference/strictTupleLength.errors.txt @@ -17,9 +17,11 @@ tests/cases/conformance/types/tuple/strictTupleLength.ts(18,1): error TS2741: Pr var t1 = t2; // error ~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 't1' must be of type '[number]', but here has type '[number, number]'. +!!! related TS6203 tests/cases/conformance/types/tuple/strictTupleLength.ts:2:5: 't1' was also declared here. var t2 = t1; // error ~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 't2' must be of type '[number, number]', but here has type '[number]'. +!!! related TS6203 tests/cases/conformance/types/tuple/strictTupleLength.ts:3:5: 't2' was also declared here. type A = T['length']; var b: A<[boolean]>; diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt index b7018031a69a1..c678337cfc9f1 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInference.errors.txt @@ -83,6 +83,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference var a9e: {}; ~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. +!!! related TS6203 tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference.ts:75:5: 'a9e' was also declared here. // Generic tag with multiple parameters of generic type passed arguments with a single best common type var a9d = someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }`; diff --git a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt index ae63e6fd04df0..e03b06d72e027 100644 --- a/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsTypeArgumentInferenceES6.errors.txt @@ -83,6 +83,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInference var a9e: {}; ~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. +!!! related TS6203 tests/cases/conformance/es6/templates/taggedTemplateStringsTypeArgumentInferenceES6.ts:75:5: 'a9e' was also declared here. // Generic tag with multiple parameters of generic type passed arguments with a single best common type var a9d = someGenerics9 `${ { x: 3 }}${ { x: 6 }}${ { x: 6 } }`; diff --git a/tests/baselines/reference/tupleTypes.errors.txt b/tests/baselines/reference/tupleTypes.errors.txt index 1cf2f113d1470..af76c872a6f38 100644 --- a/tests/baselines/reference/tupleTypes.errors.txt +++ b/tests/baselines/reference/tupleTypes.errors.txt @@ -39,6 +39,7 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n var t2: number|string; ~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 't2' must be of type 'undefined', but here has type 'string | number'. +!!! related TS6203 tests/cases/compiler/tupleTypes.ts:11:5: 't2' was also declared here. t = []; // Error ~ @@ -79,6 +80,7 @@ tests/cases/compiler/tupleTypes.ts(51,1): error TS2322: Type '[number, {}]' is n var tt2: number | string; ~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'tt2' must be of type 'undefined', but here has type 'string | number'. +!!! related TS6203 tests/cases/compiler/tupleTypes.ts:35:5: 'tt2' was also declared here. tt = tuple2(1, undefined); tt = [1, undefined]; diff --git a/tests/baselines/reference/typeArgumentInference.errors.txt b/tests/baselines/reference/typeArgumentInference.errors.txt index 95e47ab583f22..fd4bd90771e80 100644 --- a/tests/baselines/reference/typeArgumentInference.errors.txt +++ b/tests/baselines/reference/typeArgumentInference.errors.txt @@ -92,6 +92,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts(84,74 var a9e: {}; ~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Date; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. +!!! related TS6203 tests/cases/conformance/expressions/functionCalls/typeArgumentInference.ts:82:5: 'a9e' was also declared here. var a9f = someGenerics9(undefined, { x: 6, z: new Date() }, { x: 6, y: '' }); ~~~~~ !!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. diff --git a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt index 8707ff26ef052..e40f121048757 100644 --- a/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceConstructSignatures.errors.txt @@ -154,6 +154,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstruct var a9e: {}; ~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Window; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. +!!! related TS6203 tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceConstructSignatures.ts:120:5: 'a9e' was also declared here. var a9f = new someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); ~~~~~ !!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt index 3b7750f23f009..e07a0be74cb72 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.errors.txt @@ -140,6 +140,7 @@ tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConst var a9e: {}; ~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a9e' must be of type '{ x: number; z: Window; y?: undefined; } | { x: number; y: string; z?: undefined; }', but here has type '{}'. +!!! related TS6203 tests/cases/conformance/expressions/functionCalls/typeArgumentInferenceWithConstraints.ts:87:5: 'a9e' was also declared here. var a9f = someGenerics9(undefined, { x: 6, z: window }, { x: 6, y: '' }); ~~~~~ !!! error TS2345: Argument of type '{ x: number; y: string; }' is not assignable to parameter of type 'A92'. diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfEqualEqualHasNoEffect.errors.txt b/tests/baselines/reference/typeGuardOfFormTypeOfEqualEqualHasNoEffect.errors.txt index e10cf2d1a78f5..52c312ae7c08e 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfEqualEqualHasNoEffect.errors.txt +++ b/tests/baselines/reference/typeGuardOfFormTypeOfEqualEqualHasNoEffect.errors.txt @@ -21,6 +21,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHa 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'. +!!! related TS6203 tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts:10:9: 'r1' was also declared here. } if (typeof strOrBool == "boolean") { @@ -30,6 +31,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHa 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'. +!!! related TS6203 tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts:17:9: 'r2' was also declared here. } if (typeof numOrBool == "number") { @@ -39,6 +41,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHa 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'. +!!! related TS6203 tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts:24:9: 'r3' was also declared here. } if (typeof strOrC == "Object") { @@ -50,4 +53,5 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHa 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'. +!!! related TS6203 tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfEqualEqualHasNoEffect.ts:31:9: 'r4' was also declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/typeGuardOfFormTypeOfNotEqualHasNoEffect.errors.txt b/tests/baselines/reference/typeGuardOfFormTypeOfNotEqualHasNoEffect.errors.txt index a0e9cd0f7bf00..46b10e75b87b1 100644 --- a/tests/baselines/reference/typeGuardOfFormTypeOfNotEqualHasNoEffect.errors.txt +++ b/tests/baselines/reference/typeGuardOfFormTypeOfNotEqualHasNoEffect.errors.txt @@ -21,6 +21,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasN 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'. +!!! related TS6203 tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts:10:9: 'r1' was also declared here. } if (typeof strOrBool != "boolean") { @@ -30,6 +31,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasN 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'. +!!! related TS6203 tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts:17:9: 'r2' was also declared here. } if (typeof numOrBool != "number") { @@ -39,6 +41,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasN 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'. +!!! related TS6203 tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts:24:9: 'r3' was also declared here. } if (typeof strOrC != "Object") { @@ -50,4 +53,5 @@ tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasN 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'. +!!! related TS6203 tests/cases/conformance/expressions/typeGuards/typeGuardOfFormTypeOfNotEqualHasNoEffect.ts:31:9: 'r4' was also declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/typeOfEnumAndVarRedeclarations.errors.txt b/tests/baselines/reference/typeOfEnumAndVarRedeclarations.errors.txt index 89849d3a614a8..4303512121264 100644 --- a/tests/baselines/reference/typeOfEnumAndVarRedeclarations.errors.txt +++ b/tests/baselines/reference/typeOfEnumAndVarRedeclarations.errors.txt @@ -14,9 +14,11 @@ tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts(10,70): error TS2375: Dup 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; }'. +!!! related TS6203 tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts:7:5: 'x' was also declared here. 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; }'. +!!! related TS6203 tests/cases/compiler/typeOfEnumAndVarRedeclarations.ts:9:5: 'y' was also declared here. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2375: Duplicate number index signature. \ No newline at end of file diff --git a/tests/baselines/reference/typeOfThis.errors.txt b/tests/baselines/reference/typeOfThis.errors.txt index b47207670cc62..adba7ba2f9f14 100644 --- a/tests/baselines/reference/typeOfThis.errors.txt +++ b/tests/baselines/reference/typeOfThis.errors.txt @@ -27,12 +27,14 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(106,13): error TS2 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'. +!!! related TS6203 tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts:13:16: 't' was also declared here. //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'. +!!! related TS6203 tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts:17:13: 'p' was also declared here. } //type of 'this' in member accessor(get and set) body is the class instance type @@ -41,6 +43,7 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(106,13): error TS2 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'. +!!! related TS6203 tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts:23:13: 'p' was also declared here. return this; } set prop(v) { @@ -48,6 +51,7 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(106,13): error TS2 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'. +!!! related TS6203 tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts:28:13: 'p' was also declared here. p = v; v = p; } @@ -58,6 +62,7 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(106,13): error TS2 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'. +!!! related TS6203 tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts:36:13: 't' was also declared here. }; //type of 'this' in static function param list is constructor function type @@ -106,12 +111,14 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(106,13): error TS2 var t: MyGenericTestClass; ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type 'this', but here has type 'MyGenericTestClass'. +!!! related TS6203 tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts:82:16: 't' was also declared here. //type of 'this' in member function body is the class instance type var p = this; var p: MyGenericTestClass; ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyGenericTestClass'. +!!! related TS6203 tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts:86:13: 'p' was also declared here. } //type of 'this' in member accessor(get and set) body is the class instance type @@ -120,6 +127,7 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(106,13): error TS2 var p: MyGenericTestClass; ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyGenericTestClass'. +!!! related TS6203 tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts:92:13: 'p' was also declared here. return this; } set prop(v) { @@ -127,6 +135,7 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(106,13): error TS2 var p: MyGenericTestClass; ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'p' must be of type 'this', but here has type 'MyGenericTestClass'. +!!! related TS6203 tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts:97:13: 'p' was also declared here. p = v; v = p; } @@ -137,6 +146,7 @@ tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts(106,13): error TS2 var t: MyGenericTestClass; ~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 't' must be of type 'this', but here has type 'MyGenericTestClass'. +!!! related TS6203 tests/cases/conformance/expressions/thisKeyword/typeOfThis.ts:105:13: 't' was also declared here. }; //type of 'this' in static function param list is constructor function type diff --git a/tests/baselines/reference/unionTypeEquivalence.errors.txt b/tests/baselines/reference/unionTypeEquivalence.errors.txt index d561a96f97e1d..3a50459e925a3 100644 --- a/tests/baselines/reference/unionTypeEquivalence.errors.txt +++ b/tests/baselines/reference/unionTypeEquivalence.errors.txt @@ -9,6 +9,7 @@ tests/cases/conformance/types/union/unionTypeEquivalence.ts(5,5): error TS2403: 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'. +!!! related TS6203 tests/cases/conformance/types/union/unionTypeEquivalence.ts:4:5: 'x' was also declared here. // A | B is equivalent to B | A. var y: string | number; diff --git a/tests/baselines/reference/unionTypeIdentity.errors.txt b/tests/baselines/reference/unionTypeIdentity.errors.txt index 77d25bd78d1f7..4acb5895d4130 100644 --- a/tests/baselines/reference/unionTypeIdentity.errors.txt +++ b/tests/baselines/reference/unionTypeIdentity.errors.txt @@ -12,9 +12,12 @@ tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeI 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'. +!!! related TS6203 tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts:3:5: 'strOrNum' was also declared here. 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'. +!!! related TS6203 tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts:3:5: 'strOrNum' was also declared here. 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'. \ No newline at end of file +!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'strOrNum' must be of type 'string | boolean', but here has type 'number'. +!!! related TS6203 tests/cases/conformance/types/typeRelationships/typeAndMemberIdentity/unionTypeIdentity.ts:3:5: 'strOrNum' was also declared here. \ No newline at end of file diff --git a/tests/baselines/reference/unionTypeLiterals.errors.txt b/tests/baselines/reference/unionTypeLiterals.errors.txt index d976d769f5971..197f4e2364709 100644 --- a/tests/baselines/reference/unionTypeLiterals.errors.txt +++ b/tests/baselines/reference/unionTypeLiterals.errors.txt @@ -16,9 +16,11 @@ tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts( 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'. +!!! related TS6203 tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts:9:5: 'unionOfFunctionType' was also declared here. 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'. \ No newline at end of file +!!! 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'. +!!! related TS6203 tests/cases/conformance/types/specifyingTypes/typeLiterals/unionTypeLiterals.ts:13:5: 'unionOfConstructorType' was also declared here. \ No newline at end of file diff --git a/tests/baselines/reference/varBlock.errors.txt b/tests/baselines/reference/varBlock.errors.txt index 12e3fc6a629f6..bcdb58f5979e8 100644 --- a/tests/baselines/reference/varBlock.errors.txt +++ b/tests/baselines/reference/varBlock.errors.txt @@ -98,5 +98,6 @@ tests/cases/compiler/varBlock.ts(39,17): error TS1039: Initializers are not allo 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'. +!!! related TS6203 tests/cases/compiler/varBlock.ts:38:13: 'c' was also declared here. ~~ !!! error TS1039: Initializers are not allowed in ambient contexts. \ No newline at end of file diff --git a/tests/baselines/reference/witness.errors.txt b/tests/baselines/reference/witness.errors.txt index cf21a8b2ed2c8..efaed3cc43cdd 100644 --- a/tests/baselines/reference/witness.errors.txt +++ b/tests/baselines/reference/witness.errors.txt @@ -56,6 +56,7 @@ tests/cases/conformance/types/witness/witness.ts(128,19): error TS2729: Property 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'. +!!! related TS6203 tests/cases/conformance/types/witness/witness.ts:28:5: 'co1' was also declared here. var co2 = (3, 4, co2); ~ !!! error TS2695: Left side of comma operator is unused and has no side effects. @@ -72,22 +73,26 @@ tests/cases/conformance/types/witness/witness.ts(128,19): error TS2729: Property 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'. +!!! related TS6203 tests/cases/conformance/types/witness/witness.ts:32:5: 'co3' was also declared here. // 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'. +!!! related TS6203 tests/cases/conformance/types/witness/witness.ts:36:5: 'as1' was also declared here. 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'. +!!! related TS6203 tests/cases/conformance/types/witness/witness.ts:38:5: 'as2' was also declared here. // 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'. +!!! related TS6203 tests/cases/conformance/types/witness/witness.ts:42:5: 'cnd1' was also declared here. var cnd2 = cnd1 ? cnd1 ? '' : "" : ''; var cnd2: string; @@ -104,6 +109,7 @@ tests/cases/conformance/types/witness/witness.ts(128,19): error TS2729: Property 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'. +!!! related TS6203 tests/cases/conformance/types/witness/witness.ts:56:5: 'and1' was also declared here. var and2 = '' && and2; var and2: any; var and3 = and3 && and3; @@ -159,6 +165,7 @@ tests/cases/conformance/types/witness/witness.ts(128,19): error TS2729: Property 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; }'. +!!! related TS6203 tests/cases/conformance/types/witness/witness.ts:107:5: 'propAcc1' was also declared here. // Property access of module member module M2 {