Accepted baselines.

This commit is contained in:
Daniel Rosenwasser
2019-05-21 15:22:03 -07:00
parent 3f5912995b
commit 81d3595058
69 changed files with 161 additions and 10 deletions
@@ -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.
}
@@ -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();
@@ -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.
~~
@@ -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.
~~
@@ -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.
~~
@@ -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.
~~
@@ -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.
~~
@@ -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.
~~
@@ -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
@@ -71,6 +71,7 @@ tests/cases/conformance/types/tuple/castingTuple.ts(33,1): error TS2304: Cannot
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[]'.
!!! 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'.
@@ -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) ====
@@ -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.
}
@@ -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<T & U>'.
!!! related TS6203 tests/cases/conformance/types/conditional/conditionalTypes1.ts:262:9: 'z' was also declared here.
}
function f33<T, U>() {
@@ -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() {
@@ -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() {
~~
@@ -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.
}
@@ -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'.
~
@@ -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'.
~
@@ -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.
}
@@ -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'.
!!! 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.
@@ -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;
@@ -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;
@@ -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;
@@ -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'.
!!! 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.
@@ -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<keyof this, string>'.
!!! 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<keyof this, string>'.
!!! 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()) { }
@@ -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.
}
@@ -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<keyof this, string>'.
!!! 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<keyof this, string>'.
!!! 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()) { }
@@ -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<string>();;){}
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D<string>'.
!!! 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<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>)[]'.
!!! related TS6203 tests/cases/conformance/statements/forStatements/forStatementsMultipleInvalidDecl.ts:45:9: 'arr' was also declared here.
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>[]'.
!!! 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'.
!!! 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.
@@ -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;
}
@@ -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.
@@ -12,18 +12,22 @@ tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts(14,5): err
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'.
!!! related TS6203 tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts:4:5: 'g' was also declared here.
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'.
!!! related TS6203 tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts:7:5: 'h' was also declared here.
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'.
!!! related TS6203 tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts:10:5: 'i' was also declared here.
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' must be of type '<T, U>(x: T, y: U) => T', but here has type '<T, U>(x: any, y: any) => string'.
!!! related TS6203 tests/cases/compiler/identityForSignaturesWithTypeParametersAndAny.ts:13:5: 'j' was also declared here.
@@ -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 {
@@ -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<string>();
~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'any', but here has type 'D<string>'.
!!! 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<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>)[]'.
!!! related TS6203 tests/cases/conformance/statements/VariableStatements/invalidMultipleVariableDeclarations.ts:45:5: 'arr' was also declared here.
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>[]'.
!!! 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'.
!!! 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.
@@ -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'.
!!! 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.
@@ -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<T>() {
@@ -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
@@ -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.
}
}
@@ -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.
}
@@ -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
@@ -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.
@@ -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 = {
@@ -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.
@@ -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'.
@@ -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.
}
}
@@ -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();
~~~~~
@@ -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));
@@ -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));
@@ -25,12 +25,15 @@ 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'.
!!! related TS6203 tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts:1:5: 'v' was also declared here.
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'.
!!! related TS6203 tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts:1:5: 'v' was also declared here.
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'.
!!! related TS6203 tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts:1:5: 'v' was also declared here.
var v = <T>(a);
~
@@ -14,4 +14,5 @@ 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' must be of type 'IPromise<string, number>', but here has type 'Promise<any, string>'.
!!! related TS6203 tests/cases/compiler/promiseIdentity2.ts:10:5: 'x' was also declared here.
@@ -15,6 +15,7 @@ tests/cases/compiler/promiseIdentityWithAny2.ts(22,5): error TS2403: Subsequent
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>'.
!!! related TS6203 tests/cases/compiler/promiseIdentityWithAny2.ts:9:5: 'x' was also declared here.
interface IPromise2<T, V> {
@@ -28,4 +29,5 @@ 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' must be of type 'IPromise2<string, number>', but here has type 'Promise2<string, boolean>'.
!!! related TS6203 tests/cases/compiler/promiseIdentityWithAny2.ts:21:5: 'y' was also declared here.
@@ -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.
@@ -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 {
@@ -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.
}
@@ -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.
@@ -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 extends any[]> = T['length'];
var b: A<[boolean]>;
@@ -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 } }`;
@@ -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 } }`;
@@ -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];
@@ -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<A92>(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'.
@@ -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<A92>(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'.
@@ -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<A92>(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'.
@@ -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.
}
@@ -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.
}
@@ -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.
@@ -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<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>'.
!!! 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<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>'.
!!! 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<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>'.
!!! 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<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>'.
!!! 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<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>'.
!!! 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
@@ -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;
@@ -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'.
!!! 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.
@@ -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'.
!!! 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.
@@ -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.
@@ -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 {