diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index eef3e430809..c904a9e8f5f 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -1930,6 +1930,7 @@ module ts { function emitTrailingDeclarationComments(node: Declaration) { var trailingComments = getTrailingComments(currentSourceFile.text, node.end); + emitComments(trailingComments, writer, writeComment); } if (compilerOptions.sourceMap) { diff --git a/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.js b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.js index 461b844eab1..d5576c0e124 100644 --- a/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/AmbientModuleAndAmbientWithSameNameAndCommonRoot.js @@ -28,4 +28,4 @@ var p = new A.Point(0, 0); // unexpected error here, bug 840000 //// [test.js] var p; var p = A.Point.Origin; -var p = new A.Point(0, 0); +var p = new A.Point(0, 0);// unexpected error here, bug 840000 diff --git a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.js b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.js index b067168a387..d0221e8620d 100644 --- a/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/AmbientModuleAndNonAmbientClassWithSameNameAndCommonRoot.js @@ -37,4 +37,4 @@ var A; //// [test.js] var p; var p = A.Point.Origin; -var p = new A.Point(0, 0); +var p = new A.Point(0, 0);// unexpected error here, bug 840000 diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js index b9386b28f9b..f4ea22c90a3 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.js @@ -30,7 +30,7 @@ var Point = (function () { } Point.Origin = function () { return { x: 0, y: 0 }; - }; + };// unexpected error here bug 840246 return Point; })(); var Point; @@ -38,7 +38,7 @@ var Point; function Origin() { return null; } - Point.Origin = Origin; + Point.Origin = Origin;//expected duplicate identifier error })(Point || (Point = {})); var A; (function (A) { @@ -49,7 +49,7 @@ var A; } Point.Origin = function () { return { x: 0, y: 0 }; - }; + };// unexpected error here bug 840246 return Point; })(); A.Point = Point; @@ -57,7 +57,7 @@ var A; function Origin() { return ""; } - Point.Origin = Origin; + Point.Origin = Origin;//expected duplicate identifier error })(A.Point || (A.Point = {})); var Point = A.Point; })(A || (A = {})); diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js index 79e1784b4fa..638464754f9 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndNonExportedFunctionThatShareAName.js @@ -37,7 +37,7 @@ var Point; (function (Point) { function Origin() { return ""; - } + }// not an error, since not exported })(Point || (Point = {})); var A; (function (A) { @@ -55,7 +55,7 @@ var A; (function (Point) { function Origin() { return ""; - } + }// not an error since not exported })(A.Point || (A.Point = {})); var Point = A.Point; })(A || (A = {})); diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js index 9323f83a1ec..d1db9d1693e 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.js @@ -33,7 +33,7 @@ var Point = (function () { })(); var Point; (function (Point) { - Point.Origin = ""; + Point.Origin = "";//expected duplicate identifier error })(Point || (Point = {})); var A; (function (A) { @@ -47,7 +47,7 @@ var A; })(); A.Point = Point; (function (Point) { - Point.Origin = ""; + Point.Origin = "";//expected duplicate identifier error })(A.Point || (A.Point = {})); var Point = A.Point; })(A || (A = {})); diff --git a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js index 9864d9d4eb0..f1995d8bb43 100644 --- a/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js +++ b/tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndNonExportedVarThatShareAName.js @@ -33,7 +33,7 @@ var Point = (function () { })(); var Point; (function (Point) { - var Origin = ""; + var Origin = "";// not an error, since not exported })(Point || (Point = {})); var A; (function (A) { @@ -47,7 +47,7 @@ var A; })(); A.Point = Point; (function (Point) { - var Origin = ""; + var Origin = "";// not an error since not exported })(A.Point || (A.Point = {})); var Point = A.Point; })(A || (A = {})); diff --git a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js index 8babd703b0f..bf28318a86d 100644 --- a/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/ClassAndModuleWithSameNameAndCommonRoot.js @@ -69,7 +69,7 @@ var X; //// [test.js] //var cl: { x: number; y: number; } var cl = new X.Y.Point(1, 1); -var cl = X.Y.Point.Origin; +var cl = X.Y.Point.Origin;// error not expected here same as bug 83996 ? //// [simple.js] var A = (function () { function A() { diff --git a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js index e0ea0bd07ce..75bc6f46b0d 100644 --- a/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js +++ b/tests/baselines/reference/FunctionAndModuleWithSameNameAndCommonRoot.js @@ -64,7 +64,7 @@ var fn; var fn = A.Point; var cl; var cl = A.Point(); -var cl = A.Point.Origin; +var cl = A.Point.Origin;// not expected to be an error. //// [simple.js] var B; (function (B) { @@ -78,7 +78,7 @@ var B; var Point = B.Point; })(B || (B = {})); var fn; -var fn = B.Point; +var fn = B.Point;// not expected to be an error. bug 840000: [corelang] Function of fundule not assignalbe as expected var cl; var cl = B.Point(); var cl = B.Point.Origin; diff --git a/tests/baselines/reference/InvalidNonInstantiatedModule.js b/tests/baselines/reference/InvalidNonInstantiatedModule.js index 0f6c7fe62cb..bce72366f89 100644 --- a/tests/baselines/reference/InvalidNonInstantiatedModule.js +++ b/tests/baselines/reference/InvalidNonInstantiatedModule.js @@ -9,5 +9,5 @@ var x: typeof M; // Error only a namespace //// [InvalidNonInstantiatedModule.js] -var m = M; -var x; +var m = M;// Error, not instantiated can not be used as var +var x;// Error only a namespace diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.js b/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.js index d7e5eed0dfb..f96003342e1 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.js +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.js @@ -51,7 +51,7 @@ var A; var fn; var fn = A.fn; var fng; -var fng = A.fng; +var fng = A.fng;// bug 838015 // these should be errors since the functions are not exported var fn2 = A.fn2; var fng2 = A.fng2; diff --git a/tests/baselines/reference/ParameterList7.js b/tests/baselines/reference/ParameterList7.js index 725baa0740e..96a7f28cd14 100644 --- a/tests/baselines/reference/ParameterList7.js +++ b/tests/baselines/reference/ParameterList7.js @@ -9,6 +9,6 @@ class C1 { var C1 = (function () { function C1(p3) { this.p3 = p3; - } + }// OK return C1; })(); diff --git a/tests/baselines/reference/additionOperatorWithInvalidOperands.js b/tests/baselines/reference/additionOperatorWithInvalidOperands.js index 85baac8f9ca..82683158228 100644 --- a/tests/baselines/reference/additionOperatorWithInvalidOperands.js +++ b/tests/baselines/reference/additionOperatorWithInvalidOperands.js @@ -70,7 +70,7 @@ var r2 = a + b; var r3 = a + c; // number + every type except any and string var r4 = b + a; -var r5 = b + b; +var r5 = b + b;// number + number is valid var r6 = b + c; // object + every type except any and string var r7 = c + a; diff --git a/tests/baselines/reference/additionOperatorWithTypeParameter.js b/tests/baselines/reference/additionOperatorWithTypeParameter.js index 6405bf897b9..bd2a1cf8462 100644 --- a/tests/baselines/reference/additionOperatorWithTypeParameter.js +++ b/tests/baselines/reference/additionOperatorWithTypeParameter.js @@ -54,18 +54,18 @@ function foo(t, u) { var g; var f; // type parameter as left operand - var r1 = t + a; + var r1 = t + a;// ok, one operand is any var r2 = t + b; var r3 = t + c; - var r4 = t + d; + var r4 = t + d;// ok, one operand is string var r5 = t + e; var r6 = t + g; var r7 = t + f; // type parameter as right operand - var r8 = a + t; + var r8 = a + t;// ok, one operand is any var r9 = b + t; var r10 = c + t; - var r11 = d + t; + var r11 = d + t;// ok, one operand is string var r12 = e + t; var r13 = g + t; var r14 = f + t; diff --git a/tests/baselines/reference/aliasBug.js b/tests/baselines/reference/aliasBug.js index a8320d2ec9d..50e22a989d5 100644 --- a/tests/baselines/reference/aliasBug.js +++ b/tests/baselines/reference/aliasBug.js @@ -46,7 +46,7 @@ var provide = foo; var booz = foo.bar.baz; var p = new provide.Provide(); function use() { - var p1; + var p1;// error here, but should be okay var p2; var p3; var p22 = new provide.Provide(); diff --git a/tests/baselines/reference/aliasOnMergedModuleInterface.js b/tests/baselines/reference/aliasOnMergedModuleInterface.js index 73f0b3de6ce..3a1d079748e 100644 --- a/tests/baselines/reference/aliasOnMergedModuleInterface.js +++ b/tests/baselines/reference/aliasOnMergedModuleInterface.js @@ -25,4 +25,4 @@ var x: foo.A = foo.bar("hello"); // foo.A should be ok but foo.bar should be err //// [aliasOnMergedModuleInterface_1.js] var z; z.bar("hello"); -var x = foo.bar("hello"); +var x = foo.bar("hello");// foo.A should be ok but foo.bar should be error diff --git a/tests/baselines/reference/ambiguousOverloadResolution.js b/tests/baselines/reference/ambiguousOverloadResolution.js index 966c9f14628..1a59b83fcaf 100644 --- a/tests/baselines/reference/ambiguousOverloadResolution.js +++ b/tests/baselines/reference/ambiguousOverloadResolution.js @@ -28,4 +28,4 @@ var B = (function (_super) { return B; })(A); var x; -var t = f(x, x); +var t = f(x, x);// Not an error diff --git a/tests/baselines/reference/anyAsConstructor.js b/tests/baselines/reference/anyAsConstructor.js index 409a86dcc9b..9e695136f41 100644 --- a/tests/baselines/reference/anyAsConstructor.js +++ b/tests/baselines/reference/anyAsConstructor.js @@ -18,4 +18,4 @@ var a = new x(); var b = new x('hello'); var c = new x(x); // grammar allows this for constructors -var d = new x(x); +var d = new x(x);// no error diff --git a/tests/baselines/reference/anyAssignabilityInInheritance.js b/tests/baselines/reference/anyAssignabilityInInheritance.js index 261768e2981..467d7c2c9d3 100644 --- a/tests/baselines/reference/anyAssignabilityInInheritance.js +++ b/tests/baselines/reference/anyAssignabilityInInheritance.js @@ -90,40 +90,40 @@ var r3 = foo3(a); // any //// [anyAssignabilityInInheritance.js] var a; -var r3 = foo2(a); -var r3 = foo3(a); -var r3 = foo3(a); -var r3 = foo3(a); -var r3 = foo3(a); -var r3 = foo3(a); -var r3 = foo3(a); -var r3 = foo3(a); +var r3 = foo2(a);// any, not a subtype of number so it skips that overload, is a subtype of itself so it picks second (if truly ambiguous it would pick first overload) +var r3 = foo3(a);// any +var r3 = foo3(a);// any +var r3 = foo3(a);// any +var r3 = foo3(a);// any +var r3 = foo3(a);// any +var r3 = foo3(a);// any +var r3 = foo3(a);// any var A = (function () { function A() { } return A; })(); -var r3 = foo3(a); +var r3 = foo3(a);// any var A2 = (function () { function A2() { } return A2; })(); -var r3 = foo3(a); -var r3 = foo3(a); -var r3 = foo3(a); +var r3 = foo3(a);// any +var r3 = foo3(a);// any +var r3 = foo3(a);// any var E; (function (E) { E[E["A"] = 0] = "A"; })(E || (E = {})); -var r3 = foo3(a); +var r3 = foo3(a);// any function f() { } var f; (function (f) { f.bar = 1; })(f || (f = {})); -var r3 = foo3(a); +var r3 = foo3(a);// any var CC = (function () { function CC() { } @@ -133,6 +133,6 @@ var CC; (function (CC) { CC.bar = 1; })(CC || (CC = {})); -var r3 = foo3(a); -var r3 = foo3(a); -var r3 = foo3(a); +var r3 = foo3(a);// any +var r3 = foo3(a);// any +var r3 = foo3(a);// any diff --git a/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.js b/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.js index 26cbf5ffac3..b0f8fce1d26 100644 --- a/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.js +++ b/tests/baselines/reference/arithmeticOperatorWithInvalidOperands.js @@ -598,9 +598,9 @@ var e; var f; // All of the below should be an error unless otherwise noted // operator * -var r1a1 = a * a; +var r1a1 = a * a;//ok var r1a2 = a * b; -var r1a3 = a * c; +var r1a3 = a * c;//ok var r1a4 = a * d; var r1a5 = a * e; var r1a6 = a * f; @@ -610,9 +610,9 @@ var r1b3 = b * c; var r1b4 = b * d; var r1b5 = b * e; var r1b6 = b * f; -var r1c1 = c * a; +var r1c1 = c * a;//ok var r1c2 = c * b; -var r1c3 = c * c; +var r1c3 = c * c;//ok var r1c4 = c * d; var r1c5 = c * e; var r1c6 = c * f; @@ -634,22 +634,22 @@ var r1f3 = f * c; var r1f4 = f * d; var r1f5 = f * e; var r1f6 = f * f; -var r1g1 = 0 /* a */ * a; +var r1g1 = 0 /* a */ * a;//ok var r1g2 = 0 /* a */ * b; -var r1g3 = 0 /* a */ * c; +var r1g3 = 0 /* a */ * c;//ok var r1g4 = 0 /* a */ * d; var r1g5 = 0 /* a */ * e; var r1g6 = 0 /* a */ * f; -var r1h1 = a * 1 /* b */; +var r1h1 = a * 1 /* b */;//ok var r1h2 = b * 1 /* b */; -var r1h3 = c * 1 /* b */; +var r1h3 = c * 1 /* b */;//ok var r1h4 = d * 1 /* b */; var r1h5 = e * 1 /* b */; var r1h6 = f * 1 /* b */; // operator / -var r2a1 = a / a; +var r2a1 = a / a;//ok var r2a2 = a / b; -var r2a3 = a / c; +var r2a3 = a / c;//ok var r2a4 = a / d; var r2a5 = a / e; var r2a6 = a / f; @@ -659,9 +659,9 @@ var r2b3 = b / c; var r2b4 = b / d; var r2b5 = b / e; var r2b6 = b / f; -var r2c1 = c / a; +var r2c1 = c / a;//ok var r2c2 = c / b; -var r2c3 = c / c; +var r2c3 = c / c;//ok var r2c4 = c / d; var r2c5 = c / e; var r2c6 = c / f; @@ -683,22 +683,22 @@ var r2f3 = f / c; var r2f4 = f / d; var r2f5 = f / e; var r2f6 = f / f; -var r2g1 = 0 /* a */ / a; +var r2g1 = 0 /* a */ / a;//ok var r2g2 = 0 /* a */ / b; -var r2g3 = 0 /* a */ / c; +var r2g3 = 0 /* a */ / c;//ok var r2g4 = 0 /* a */ / d; var r2g5 = 0 /* a */ / e; var r2g6 = 0 /* a */ / f; -var r2h1 = a / 1 /* b */; +var r2h1 = a / 1 /* b */;//ok var r2h2 = b / 1 /* b */; -var r2h3 = c / 1 /* b */; +var r2h3 = c / 1 /* b */;//ok var r2h4 = d / 1 /* b */; var r2h5 = e / 1 /* b */; var r2h6 = f / 1 /* b */; // operator % -var r3a1 = a % a; +var r3a1 = a % a;//ok var r3a2 = a % b; -var r3a3 = a % c; +var r3a3 = a % c;//ok var r3a4 = a % d; var r3a5 = a % e; var r3a6 = a % f; @@ -708,9 +708,9 @@ var r3b3 = b % c; var r3b4 = b % d; var r3b5 = b % e; var r3b6 = b % f; -var r3c1 = c % a; +var r3c1 = c % a;//ok var r3c2 = c % b; -var r3c3 = c % c; +var r3c3 = c % c;//ok var r3c4 = c % d; var r3c5 = c % e; var r3c6 = c % f; @@ -732,22 +732,22 @@ var r3f3 = f % c; var r3f4 = f % d; var r3f5 = f % e; var r3f6 = f % f; -var r3g1 = 0 /* a */ % a; +var r3g1 = 0 /* a */ % a;//ok var r3g2 = 0 /* a */ % b; -var r3g3 = 0 /* a */ % c; +var r3g3 = 0 /* a */ % c;//ok var r3g4 = 0 /* a */ % d; var r3g5 = 0 /* a */ % e; var r3g6 = 0 /* a */ % f; -var r3h1 = a % 1 /* b */; +var r3h1 = a % 1 /* b */;//ok var r3h2 = b % 1 /* b */; -var r3h3 = c % 1 /* b */; +var r3h3 = c % 1 /* b */;//ok var r3h4 = d % 1 /* b */; var r3h5 = e % 1 /* b */; var r3h6 = f % 1 /* b */; // operator - -var r4a1 = a - a; +var r4a1 = a - a;//ok var r4a2 = a - b; -var r4a3 = a - c; +var r4a3 = a - c;//ok var r4a4 = a - d; var r4a5 = a - e; var r4a6 = a - f; @@ -757,9 +757,9 @@ var r4b3 = b - c; var r4b4 = b - d; var r4b5 = b - e; var r4b6 = b - f; -var r4c1 = c - a; +var r4c1 = c - a;//ok var r4c2 = c - b; -var r4c3 = c - c; +var r4c3 = c - c;//ok var r4c4 = c - d; var r4c5 = c - e; var r4c6 = c - f; @@ -781,22 +781,22 @@ var r4f3 = f - c; var r4f4 = f - d; var r4f5 = f - e; var r4f6 = f - f; -var r4g1 = 0 /* a */ - a; +var r4g1 = 0 /* a */ - a;//ok var r4g2 = 0 /* a */ - b; -var r4g3 = 0 /* a */ - c; +var r4g3 = 0 /* a */ - c;//ok var r4g4 = 0 /* a */ - d; var r4g5 = 0 /* a */ - e; var r4g6 = 0 /* a */ - f; -var r4h1 = a - 1 /* b */; +var r4h1 = a - 1 /* b */;//ok var r4h2 = b - 1 /* b */; -var r4h3 = c - 1 /* b */; +var r4h3 = c - 1 /* b */;//ok var r4h4 = d - 1 /* b */; var r4h5 = e - 1 /* b */; var r4h6 = f - 1 /* b */; // operator << -var r5a1 = a << a; +var r5a1 = a << a;//ok var r5a2 = a << b; -var r5a3 = a << c; +var r5a3 = a << c;//ok var r5a4 = a << d; var r5a5 = a << e; var r5a6 = a << f; @@ -806,9 +806,9 @@ var r5b3 = b << c; var r5b4 = b << d; var r5b5 = b << e; var r5b6 = b << f; -var r5c1 = c << a; +var r5c1 = c << a;//ok var r5c2 = c << b; -var r5c3 = c << c; +var r5c3 = c << c;//ok var r5c4 = c << d; var r5c5 = c << e; var r5c6 = c << f; @@ -830,22 +830,22 @@ var r5f3 = f << c; var r5f4 = f << d; var r5f5 = f << e; var r5f6 = f << f; -var r5g1 = 0 /* a */ << a; +var r5g1 = 0 /* a */ << a;//ok var r5g2 = 0 /* a */ << b; -var r5g3 = 0 /* a */ << c; +var r5g3 = 0 /* a */ << c;//ok var r5g4 = 0 /* a */ << d; var r5g5 = 0 /* a */ << e; var r5g6 = 0 /* a */ << f; -var r5h1 = a << 1 /* b */; +var r5h1 = a << 1 /* b */;//ok var r5h2 = b << 1 /* b */; -var r5h3 = c << 1 /* b */; +var r5h3 = c << 1 /* b */;//ok var r5h4 = d << 1 /* b */; var r5h5 = e << 1 /* b */; var r5h6 = f << 1 /* b */; // operator >> -var r6a1 = a >> a; +var r6a1 = a >> a;//ok var r6a2 = a >> b; -var r6a3 = a >> c; +var r6a3 = a >> c;//ok var r6a4 = a >> d; var r6a5 = a >> e; var r6a6 = a >> f; @@ -855,9 +855,9 @@ var r6b3 = b >> c; var r6b4 = b >> d; var r6b5 = b >> e; var r6b6 = b >> f; -var r6c1 = c >> a; +var r6c1 = c >> a;//ok var r6c2 = c >> b; -var r6c3 = c >> c; +var r6c3 = c >> c;//ok var r6c4 = c >> d; var r6c5 = c >> e; var r6c6 = c >> f; @@ -879,22 +879,22 @@ var r6f3 = f >> c; var r6f4 = f >> d; var r6f5 = f >> e; var r6f6 = f >> f; -var r6g1 = 0 /* a */ >> a; +var r6g1 = 0 /* a */ >> a;//ok var r6g2 = 0 /* a */ >> b; -var r6g3 = 0 /* a */ >> c; +var r6g3 = 0 /* a */ >> c;//ok var r6g4 = 0 /* a */ >> d; var r6g5 = 0 /* a */ >> e; var r6g6 = 0 /* a */ >> f; -var r6h1 = a >> 1 /* b */; +var r6h1 = a >> 1 /* b */;//ok var r6h2 = b >> 1 /* b */; -var r6h3 = c >> 1 /* b */; +var r6h3 = c >> 1 /* b */;//ok var r6h4 = d >> 1 /* b */; var r6h5 = e >> 1 /* b */; var r6h6 = f >> 1 /* b */; // operator >>> -var r7a1 = a >>> a; +var r7a1 = a >>> a;//ok var r7a2 = a >>> b; -var r7a3 = a >>> c; +var r7a3 = a >>> c;//ok var r7a4 = a >>> d; var r7a5 = a >>> e; var r7a6 = a >>> f; @@ -904,9 +904,9 @@ var r7b3 = b >>> c; var r7b4 = b >>> d; var r7b5 = b >>> e; var r7b6 = b >>> f; -var r7c1 = c >>> a; +var r7c1 = c >>> a;//ok var r7c2 = c >>> b; -var r7c3 = c >>> c; +var r7c3 = c >>> c;//ok var r7c4 = c >>> d; var r7c5 = c >>> e; var r7c6 = c >>> f; @@ -928,22 +928,22 @@ var r7f3 = f >>> c; var r7f4 = f >>> d; var r7f5 = f >>> e; var r7f6 = f >>> f; -var r7g1 = 0 /* a */ >>> a; +var r7g1 = 0 /* a */ >>> a;//ok var r7g2 = 0 /* a */ >>> b; -var r7g3 = 0 /* a */ >>> c; +var r7g3 = 0 /* a */ >>> c;//ok var r7g4 = 0 /* a */ >>> d; var r7g5 = 0 /* a */ >>> e; var r7g6 = 0 /* a */ >>> f; -var r7h1 = a >>> 1 /* b */; +var r7h1 = a >>> 1 /* b */;//ok var r7h2 = b >>> 1 /* b */; -var r7h3 = c >>> 1 /* b */; +var r7h3 = c >>> 1 /* b */;//ok var r7h4 = d >>> 1 /* b */; var r7h5 = e >>> 1 /* b */; var r7h6 = f >>> 1 /* b */; // operator & -var r8a1 = a & a; +var r8a1 = a & a;//ok var r8a2 = a & b; -var r8a3 = a & c; +var r8a3 = a & c;//ok var r8a4 = a & d; var r8a5 = a & e; var r8a6 = a & f; @@ -953,9 +953,9 @@ var r8b3 = b & c; var r8b4 = b & d; var r8b5 = b & e; var r8b6 = b & f; -var r8c1 = c & a; +var r8c1 = c & a;//ok var r8c2 = c & b; -var r8c3 = c & c; +var r8c3 = c & c;//ok var r8c4 = c & d; var r8c5 = c & e; var r8c6 = c & f; @@ -977,22 +977,22 @@ var r8f3 = f & c; var r8f4 = f & d; var r8f5 = f & e; var r8f6 = f & f; -var r8g1 = 0 /* a */ & a; +var r8g1 = 0 /* a */ & a;//ok var r8g2 = 0 /* a */ & b; -var r8g3 = 0 /* a */ & c; +var r8g3 = 0 /* a */ & c;//ok var r8g4 = 0 /* a */ & d; var r8g5 = 0 /* a */ & e; var r8g6 = 0 /* a */ & f; -var r8h1 = a & 1 /* b */; +var r8h1 = a & 1 /* b */;//ok var r8h2 = b & 1 /* b */; -var r8h3 = c & 1 /* b */; +var r8h3 = c & 1 /* b */;//ok var r8h4 = d & 1 /* b */; var r8h5 = e & 1 /* b */; var r8h6 = f & 1 /* b */; // operator ^ -var r9a1 = a ^ a; +var r9a1 = a ^ a;//ok var r9a2 = a ^ b; -var r9a3 = a ^ c; +var r9a3 = a ^ c;//ok var r9a4 = a ^ d; var r9a5 = a ^ e; var r9a6 = a ^ f; @@ -1002,9 +1002,9 @@ var r9b3 = b ^ c; var r9b4 = b ^ d; var r9b5 = b ^ e; var r9b6 = b ^ f; -var r9c1 = c ^ a; +var r9c1 = c ^ a;//ok var r9c2 = c ^ b; -var r9c3 = c ^ c; +var r9c3 = c ^ c;//ok var r9c4 = c ^ d; var r9c5 = c ^ e; var r9c6 = c ^ f; @@ -1026,22 +1026,22 @@ var r9f3 = f ^ c; var r9f4 = f ^ d; var r9f5 = f ^ e; var r9f6 = f ^ f; -var r9g1 = 0 /* a */ ^ a; +var r9g1 = 0 /* a */ ^ a;//ok var r9g2 = 0 /* a */ ^ b; -var r9g3 = 0 /* a */ ^ c; +var r9g3 = 0 /* a */ ^ c;//ok var r9g4 = 0 /* a */ ^ d; var r9g5 = 0 /* a */ ^ e; var r9g6 = 0 /* a */ ^ f; -var r9h1 = a ^ 1 /* b */; +var r9h1 = a ^ 1 /* b */;//ok var r9h2 = b ^ 1 /* b */; -var r9h3 = c ^ 1 /* b */; +var r9h3 = c ^ 1 /* b */;//ok var r9h4 = d ^ 1 /* b */; var r9h5 = e ^ 1 /* b */; var r9h6 = f ^ 1 /* b */; // operator | -var r10a1 = a | a; +var r10a1 = a | a;//ok var r10a2 = a | b; -var r10a3 = a | c; +var r10a3 = a | c;//ok var r10a4 = a | d; var r10a5 = a | e; var r10a6 = a | f; @@ -1051,9 +1051,9 @@ var r10b3 = b | c; var r10b4 = b | d; var r10b5 = b | e; var r10b6 = b | f; -var r10c1 = c | a; +var r10c1 = c | a;//ok var r10c2 = c | b; -var r10c3 = c | c; +var r10c3 = c | c;//ok var r10c4 = c | d; var r10c5 = c | e; var r10c6 = c | f; @@ -1075,15 +1075,15 @@ var r10f3 = f | c; var r10f4 = f | d; var r10f5 = f | e; var r10f6 = f | f; -var r10g1 = 0 /* a */ | a; +var r10g1 = 0 /* a */ | a;//ok var r10g2 = 0 /* a */ | b; -var r10g3 = 0 /* a */ | c; +var r10g3 = 0 /* a */ | c;//ok var r10g4 = 0 /* a */ | d; var r10g5 = 0 /* a */ | e; var r10g6 = 0 /* a */ | f; -var r10h1 = a | 1 /* b */; +var r10h1 = a | 1 /* b */;//ok var r10h2 = b | 1 /* b */; -var r10h3 = c | 1 /* b */; +var r10h3 = c | 1 /* b */;//ok var r10h4 = d | 1 /* b */; var r10h5 = e | 1 /* b */; var r10h6 = f | 1 /* b */; diff --git a/tests/baselines/reference/arrayAssignmentTest1.js b/tests/baselines/reference/arrayAssignmentTest1.js index 4abd6b534ff..d876f78309e 100644 --- a/tests/baselines/reference/arrayAssignmentTest1.js +++ b/tests/baselines/reference/arrayAssignmentTest1.js @@ -149,10 +149,10 @@ var arr_i1_2 = []; var arr_c1_2 = []; var arr_c2_2 = []; var arr_c3 = []; -var i1_error = []; -var c1_error = []; -var c2_error = []; -var c3_error = []; +var i1_error = [];// should be an error - is +var c1_error = [];// should be an error - is +var c2_error = [];// should be an error - is +var c3_error = [];// should be an error - is arr_any = arr_i1; arr_any = arr_c1; arr_any = arr_c2; diff --git a/tests/baselines/reference/arrayAssignmentTest2.js b/tests/baselines/reference/arrayAssignmentTest2.js index d7aef759546..2f6d610ee1a 100644 --- a/tests/baselines/reference/arrayAssignmentTest2.js +++ b/tests/baselines/reference/arrayAssignmentTest2.js @@ -129,7 +129,7 @@ arr_c3 = arr_i1_2; arr_any = f1; arr_any = function () { return null; -}; +}// should be an error - is ; arr_any = o1; arr_any = a1; arr_any = c1; diff --git a/tests/baselines/reference/arrayAssignmentTest4.js b/tests/baselines/reference/arrayAssignmentTest4.js index 87ddf2d41b4..6a391264399 100644 --- a/tests/baselines/reference/arrayAssignmentTest4.js +++ b/tests/baselines/reference/arrayAssignmentTest4.js @@ -51,5 +51,5 @@ var o1 = { one: 1 }; var arr_any = []; arr_any = function () { return null; -}; +}// should be an error - is ; arr_any = c3; diff --git a/tests/baselines/reference/arrayAugment.js b/tests/baselines/reference/arrayAugment.js index b9023a5b15e..71663b6ffbf 100644 --- a/tests/baselines/reference/arrayAugment.js +++ b/tests/baselines/reference/arrayAugment.js @@ -11,4 +11,4 @@ var y: string[][]; // Expect no error here //// [arrayAugment.js] var x = ['']; var y = x.split(4); -var y; +var y;// Expect no error here diff --git a/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.js b/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.js index 879c08073a6..cdfaaef08ac 100644 --- a/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.js +++ b/tests/baselines/reference/arrayLiteralAndArrayConstructorEquivalence1.js @@ -16,7 +16,7 @@ myCars3 = myCars5; //// [arrayLiteralAndArrayConstructorEquivalence1.js] var myCars = new Array(); var myCars3 = new Array({}); -var myCars4; +var myCars4;// error var myCars5; myCars = myCars3; myCars = myCars4; diff --git a/tests/baselines/reference/arrayLiteralWidened.js b/tests/baselines/reference/arrayLiteralWidened.js index 53d2a19a1a4..0811e20effb 100644 --- a/tests/baselines/reference/arrayLiteralWidened.js +++ b/tests/baselines/reference/arrayLiteralWidened.js @@ -16,11 +16,11 @@ var c = [[[null]],[undefined]] //// [arrayLiteralWidened.js] // array literals are widened upon assignment according to their element type -var a = []; +var a = [];// any[] var a = [null, null]; var a = [undefined, undefined]; -var b = [[], [null, null]]; +var b = [[], [null, null]];// any[][] var b = [[], []]; var b = [[undefined, undefined]]; -var c = [[[]]]; +var c = [[[]]];// any[][][] var c = [[[null]], [undefined]]; diff --git a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.js b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.js index d2ca43796f0..8e72abf0b9e 100644 --- a/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.js +++ b/tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.js @@ -20,10 +20,10 @@ var gs = [(b: { x: number; z?: number }) => 2, (a: { x: number; y?: number }) => var a; var b; var c; -var as = [a, b]; -var bs = [b, a]; -var cs = [a, b, c]; -var ds = [function (x) { return 1; }, function (x) { return 2; }]; -var es = [function (x) { return 2; }, function (x) { return 1; }]; -var fs = [function (a) { return 1; }, function (b) { return 2; }]; -var gs = [function (b) { return 2; }, function (a) { return 1; }]; +var as = [a, b];// { x: number; y?: number };[] +var bs = [b, a];// { x: number; z?: number };[] +var cs = [a, b, c];// { x: number; y?: number };[] +var ds = [function (x) { return 1; }, function (x) { return 2; }];// { (x:Object) => number }[] +var es = [function (x) { return 2; }, function (x) { return 1; }];// { (x:string) => number }[] +var fs = [function (a) { return 1; }, function (b) { return 2; }];// (a: { x: number; y?: number }) => number[] +var gs = [function (b) { return 2; }, function (a) { return 1; }];// (b: { x: number; z?: number }) => number[] diff --git a/tests/baselines/reference/arrayLiterals.js b/tests/baselines/reference/arrayLiterals.js index f4dcb6ea2fe..7d65e5727b1 100644 --- a/tests/baselines/reference/arrayLiterals.js +++ b/tests/baselines/reference/arrayLiterals.js @@ -53,9 +53,9 @@ var __extends = this.__extends || function (d, b) { }; // Empty array literal with no contextual type has type Undefined[] var arr1 = [[], [1], ['']]; -var arr1; +var arr1;// Bug 825172: Error ({}[] does not match {}[]), but should be OK var arr2 = [[null], [1], ['']]; -var arr2; +var arr2;// Bug 825172: Error ({}[] does not match {}[]), but should be OK // Array literal with elements of only EveryType E has type E[] var stringArrArr = [[''], [""]]; var stringArrArr; @@ -71,13 +71,13 @@ var C = (function () { return C; })(); var classArr = [new C(), new C()]; -var classArr; +var classArr;// Should be OK var classTypeArray = [C, C, C]; -var classTypeArray; +var classTypeArray;// Should OK, not be a parse error // Contextual type C with numeric index signature makes array literal of EveryType E of type BCT(E,C)[] var context1 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; var context2 = [{ a: '', b: 0, c: '' }, { a: "", b: 3, c: 0 }]; -var context2; +var context2;// Should be OK // Contextual type C with numeric index signature of type Base makes array literal of Derived have type Base[] var Base = (function () { function Base() { diff --git a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js index 335446ea3be..01862a7e46d 100644 --- a/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js +++ b/tests/baselines/reference/arrayLiteralsWithRecursiveGenerics.js @@ -52,8 +52,8 @@ var MyList = (function () { var list; var list2; var myList; -var xs = [list, myList]; -var ys = [list, list2]; -var zs = [list, null]; +var xs = [list, myList];// {}[] +var ys = [list, list2];// {}[] +var zs = [list, null];// List[] var myDerivedList; -var as = [list, myDerivedList]; +var as = [list, myDerivedList];// List[] diff --git a/tests/baselines/reference/arrayOfFunctionTypes3.js b/tests/baselines/reference/arrayOfFunctionTypes3.js index 9d07a3211f9..bf560f27323 100644 --- a/tests/baselines/reference/arrayOfFunctionTypes3.js +++ b/tests/baselines/reference/arrayOfFunctionTypes3.js @@ -43,11 +43,11 @@ var b; var c; var z = [a, b, c]; var r4 = z[0]; -var r5 = r4(''); +var r5 = r4('');// any not string var r5b = r4(1); var a2; var b2; var c2; var z2 = [a2, b2, c2]; var r6 = z2[0]; -var r7 = r6(''); +var r7 = r6('');// any not string diff --git a/tests/baselines/reference/arrayTypeOfFunctionTypes.js b/tests/baselines/reference/arrayTypeOfFunctionTypes.js index 3c2aa7f1bcf..dbaea6d447f 100644 --- a/tests/baselines/reference/arrayTypeOfFunctionTypes.js +++ b/tests/baselines/reference/arrayTypeOfFunctionTypes.js @@ -25,8 +25,8 @@ var r2b = new r(); var x2; var r3 = x2[1]; var r4 = r3(); -var r4b = new r3(); +var r4b = new r3();// error var x3; var r5 = x2[1]; var r6 = r5(); -var r6b = new r5(); +var r6b = new r5();// error diff --git a/tests/baselines/reference/arrowFunctionContexts.js b/tests/baselines/reference/arrowFunctionContexts.js index 899df623079..a69951cca1c 100644 --- a/tests/baselines/reference/arrowFunctionContexts.js +++ b/tests/baselines/reference/arrowFunctionContexts.js @@ -123,14 +123,14 @@ var Derived = (function (_super) { window.setTimeout(function () { return null; }, 100); // Arrow function as value in array literal var obj = function (n) { return ''; }; -var obj; +var obj;// OK var arr = [function (n) { return ''; }]; -var arr; +var arr;// Incorrect error here (bug 829597) // Arrow function as enum value var E; (function (E) { E[E["x"] = function () { return 4; }] = "x"; - E[E["y"] = (function () { return _this; }).length] = "y"; + E[E["y"] = (function () { return _this; }).length] = "y";// error, can't use this in enum })(E || (E = {})); // Arrow function as module variable initializer var M; @@ -161,9 +161,9 @@ var M2; window.setTimeout(function () { return null; }, 100); // Arrow function as value in array literal var obj = function (n) { return ''; }; - var obj; + var obj;// OK var arr = [function (n) { return ''; }]; - var arr; + var arr;// Incorrect error here (bug 829597) // Arrow function as enum value var E; (function (E) { @@ -179,7 +179,7 @@ var M2; })(M2 || (M2 = {})); // (ParamList) => { ... } is a generic arrow function var generic1 = function (n) { return [n]; }; -var generic1; +var generic1;// Incorrect error, Bug 829597 var generic2 = function (n) { return [n]; }; diff --git a/tests/baselines/reference/arrowFunctionInConstructorArgument1.js b/tests/baselines/reference/arrowFunctionInConstructorArgument1.js index 01645771343..42046f09c45 100644 --- a/tests/baselines/reference/arrowFunctionInConstructorArgument1.js +++ b/tests/baselines/reference/arrowFunctionInConstructorArgument1.js @@ -13,4 +13,4 @@ var C = (function () { })(); var c = new C(function () { return asdf; -}); +})// should error ;// should error diff --git a/tests/baselines/reference/assignmentCompatBug2.js b/tests/baselines/reference/assignmentCompatBug2.js index 10c2a090ca5..5d57ffe60be 100644 --- a/tests/baselines/reference/assignmentCompatBug2.js +++ b/tests/baselines/reference/assignmentCompatBug2.js @@ -39,7 +39,7 @@ b3 = { }; // error //// [assignmentCompatBug2.js] -var b2 = { a: 0 }; +var b2 = { a: 0 };// error b2 = { a: 0 }; b2 = { b: 0, a: 0 }; var b3; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignatures3.js b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js index ea53f47e6a2..f0de8f69807 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignatures3.js @@ -199,7 +199,7 @@ b15 = a15; var b16; a16 = b16; b16 = a16; -var b17; +var b17;// ok a17 = b17; b17 = a17; var b18; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.js b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.js index da0bb3bac22..b95f41207e7 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithOptionalParameters.js @@ -72,7 +72,7 @@ var a5: (x?: number, y?: number) => number; //// [assignmentCompatWithCallSignaturesWithOptionalParameters.js] var b; var a; -a = function () { return 1; }; +a = function () { return 1; }// ok, same number of required params ; a = function (x) { return 1; }; a = function (x) { return 1; }; a = b.a; diff --git a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.js b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.js index 25bc22acb64..17a5d483354 100644 --- a/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.js +++ b/tests/baselines/reference/assignmentCompatWithCallSignaturesWithRestParameters.js @@ -46,7 +46,7 @@ var a4: (x?: number, y?: string, ...z: number[]) => number; a4 = (x: number, ...args: string[]) => 1; // error, rest params have type mismatch //// [assignmentCompatWithCallSignaturesWithRestParameters.js] -var a; +var a;// ok, same number of required params a = function () { return 1; }; a = function () { var args = []; diff --git a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js index 402cdf1b7ed..3a33f30aca5 100644 --- a/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js +++ b/tests/baselines/reference/assignmentCompatWithConstructSignatures3.js @@ -199,7 +199,7 @@ b15 = a15; var b16; a16 = b16; b16 = a16; -var b17; +var b17;// ok a17 = b17; b17 = a17; var b18; diff --git a/tests/baselines/reference/assignmentToObject.js b/tests/baselines/reference/assignmentToObject.js index 6c11d67dd68..ee96e3519e3 100644 --- a/tests/baselines/reference/assignmentToObject.js +++ b/tests/baselines/reference/assignmentToObject.js @@ -6,5 +6,5 @@ var c: Object = a; // should be error //// [assignmentToObject.js] var a = { toString: 5 }; -var b = a; -var c = a; +var b = a;// ok +var c = a;// should be error diff --git a/tests/baselines/reference/assignmentToObjectAndFunction.js b/tests/baselines/reference/assignmentToObjectAndFunction.js index 48395b3bdc0..b4e4fada96f 100644 --- a/tests/baselines/reference/assignmentToObjectAndFunction.js +++ b/tests/baselines/reference/assignmentToObjectAndFunction.js @@ -30,20 +30,20 @@ module bad { var badFundule: Function = bad; // error //// [assignmentToObjectAndFunction.js] -var errObj = { toString: 0 }; +var errObj = { toString: 0 };// Error, incompatible toString var goodObj = { toString: function (x) { return ""; } -}; -var errFun = {}; +};// Ok, because toString is a subtype of Object's toString +var errFun = {};// Error for no call signature function foo() { } var foo; (function (foo) { foo.boom = 0; })(foo || (foo = {})); -var goodFundule = foo; +var goodFundule = foo;// ok function bar() { } var bar; @@ -52,11 +52,11 @@ var bar; } bar.apply = apply; })(bar || (bar = {})); -var goodFundule2 = bar; +var goodFundule2 = bar;// ok function bad() { } var bad; (function (bad) { bad.apply = 0; })(bad || (bad = {})); -var badFundule = bad; +var badFundule = bad;// error diff --git a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.js b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.js index f05f0adbe8c..515e1efd352 100644 --- a/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.js +++ b/tests/baselines/reference/augmentedTypeAssignmentCompatIndexSignature.js @@ -25,5 +25,5 @@ var v2: { var o = {}; var f = function () { }; -var v1 = o; -var v2 = f; +var v1 = o;// Should be allowed +var v2 = f;// Should be allowed diff --git a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.js b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.js index 87d6b23e973..f91d0655b4b 100644 --- a/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.js +++ b/tests/baselines/reference/augmentedTypeBracketAccessIndexSignature.js @@ -14,6 +14,6 @@ var a = {}[0]; // Should be Foo var b = (() => { })[0]; // Should be Bar //// [augmentedTypeBracketAccessIndexSignature.js] -var a = {}[0]; +var a = {}[0];// Should be Foo var b = (function () { -})[0]; +})[0];// Should be Bar diff --git a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.js b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.js index b1d5fb71308..238c72a9414 100644 --- a/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.js +++ b/tests/baselines/reference/augmentedTypeBracketNamedPropertyAccess.js @@ -17,7 +17,7 @@ var r4 = f['data']; // Should be number var o = {}; var f = function () { }; -var r1 = o['data']; -var r2 = o['functionData']; -var r3 = f['functionData']; -var r4 = f['data']; +var r1 = o['data'];// Should be number +var r2 = o['functionData'];// Should be any (no property found) +var r3 = f['functionData'];// Should be string +var r4 = f['data'];// Should be number diff --git a/tests/baselines/reference/augmentedTypesClass.js b/tests/baselines/reference/augmentedTypesClass.js index 6fe02ba5149..9985f917284 100644 --- a/tests/baselines/reference/augmentedTypesClass.js +++ b/tests/baselines/reference/augmentedTypesClass.js @@ -16,7 +16,7 @@ var c1 = (function () { }; return c1; })(); -var c1 = 1; +var c1 = 1;// error //// class then enum var c4 = (function () { function c4() { @@ -28,4 +28,4 @@ var c4 = (function () { var c4; (function (c4) { c4[c4["One"] = 0] = "One"; -})(c4 || (c4 = {})); +})(c4 || (c4 = {}));// error diff --git a/tests/baselines/reference/augmentedTypesClass2a.js b/tests/baselines/reference/augmentedTypesClass2a.js index dde530fd716..4253a6a37da 100644 --- a/tests/baselines/reference/augmentedTypesClass2a.js +++ b/tests/baselines/reference/augmentedTypesClass2a.js @@ -14,6 +14,6 @@ var c2 = (function () { return c2; })(); function c2() { -} +}// error var c2 = function () { }; diff --git a/tests/baselines/reference/augmentedTypesClass3.js b/tests/baselines/reference/augmentedTypesClass3.js index 4af93a3bf2d..de24632ebd9 100644 --- a/tests/baselines/reference/augmentedTypesClass3.js +++ b/tests/baselines/reference/augmentedTypesClass3.js @@ -32,7 +32,7 @@ var c5a = (function () { var c5a; (function (c5a) { var y = 2; -})(c5a || (c5a = {})); +})(c5a || (c5a = {}));// should be ok var c5b = (function () { function c5b() { } @@ -43,7 +43,7 @@ var c5b = (function () { var c5b; (function (c5b) { c5b.y = 2; -})(c5b || (c5b = {})); +})(c5b || (c5b = {}));// should be ok //// class then import var c5c = (function () { function c5c() { diff --git a/tests/baselines/reference/augmentedTypesClass4.js b/tests/baselines/reference/augmentedTypesClass4.js index 4f10c469ff1..738f58b2f91 100644 --- a/tests/baselines/reference/augmentedTypesClass4.js +++ b/tests/baselines/reference/augmentedTypesClass4.js @@ -19,4 +19,4 @@ var c3 = (function () { c3.prototype.bar = function () { }; return c3; -})(); +})();// error diff --git a/tests/baselines/reference/augmentedTypesEnum.js b/tests/baselines/reference/augmentedTypesEnum.js index 4aaf83ee081..5795f40e018 100644 --- a/tests/baselines/reference/augmentedTypesEnum.js +++ b/tests/baselines/reference/augmentedTypesEnum.js @@ -41,20 +41,20 @@ var e1111; (function (e1111) { e1111[e1111["One"] = 0] = "One"; })(e1111 || (e1111 = {})); -var e1111 = 1; +var e1111 = 1;// error // enum then function var e2; (function (e2) { e2[e2["One"] = 0] = "One"; })(e2 || (e2 = {})); function e2() { -} +}// error var e3; (function (e3) { e3[e3["One"] = 0] = "One"; })(e3 || (e3 = {})); var e3 = function () { -}; +}// error // error ;// error // enum then class var e4; (function (e4) { @@ -66,7 +66,7 @@ var e4 = (function () { e4.prototype.foo = function () { }; return e4; -})(); +})();// error // enum then enum var e5; (function (e5) { @@ -83,7 +83,7 @@ var e5a; var e5a; (function (e5a) { e5a[e5a["One"] = 0] = "One"; -})(e5a || (e5a = {})); +})(e5a || (e5a = {}));// error // enum then internal module var e6; (function (e6) { @@ -96,7 +96,7 @@ var e6a; var e6a; (function (e6a) { var y = 2; -})(e6a || (e6a = {})); +})(e6a || (e6a = {}));// should be error var e6b; (function (e6b) { e6b[e6b["One"] = 0] = "One"; @@ -104,4 +104,4 @@ var e6b; var e6b; (function (e6b) { e6b.y = 2; -})(e6b || (e6b = {})); +})(e6b || (e6b = {}));// should be error diff --git a/tests/baselines/reference/augmentedTypesFunction.js b/tests/baselines/reference/augmentedTypesFunction.js index a074a24054d..cecb3f9c905 100644 --- a/tests/baselines/reference/augmentedTypesFunction.js +++ b/tests/baselines/reference/augmentedTypesFunction.js @@ -42,16 +42,16 @@ module y5c { export interface I { foo(): void } } // should be an error // function then var function y1() { } -var y1 = 1; +var y1 = 1;// error // function then function function y2() { } function y2() { -} +}// error function y2a() { } var y2a = function () { -}; +}// error // error ;// error // function then class function y3() { } @@ -59,7 +59,7 @@ var y3 = (function () { function y3() { } return y3; -})(); +})();// error function y3a() { } var y3a = (function () { @@ -68,14 +68,14 @@ var y3a = (function () { y3a.prototype.foo = function () { }; return y3a; -})(); +})();// error // function then enum function y4() { } var y4; (function (y4) { y4[y4["One"] = 0] = "One"; -})(y4 || (y4 = {})); +})(y4 || (y4 = {}));// error // function then internal module function y5() { } @@ -84,12 +84,12 @@ function y5a() { var y5a; (function (y5a) { var y = 2; -})(y5a || (y5a = {})); +})(y5a || (y5a = {}));// should be an error function y5b() { } var y5b; (function (y5b) { y5b.y = 3; -})(y5b || (y5b = {})); +})(y5b || (y5b = {}));// should be an error function y5c() { } diff --git a/tests/baselines/reference/augmentedTypesModules.js b/tests/baselines/reference/augmentedTypesModules.js index bf172ab56b8..17534c173bc 100644 --- a/tests/baselines/reference/augmentedTypesModules.js +++ b/tests/baselines/reference/augmentedTypesModules.js @@ -98,7 +98,7 @@ module m6 { export var y = 2; } //// [augmentedTypesModules.js] -var m1 = 1; +var m1 = 1;// Should be allowed var m1a; (function (m1a) { var y = 2; @@ -109,7 +109,7 @@ var m1b; m1b.y = 2; })(m1b || (m1b = {})); var m1b = 1; -var m1c = 1; +var m1c = 1;// Should be allowed var m1d; (function (m1d) { var I = (function () { @@ -121,7 +121,7 @@ var m1d; })(); m1d.I = I; })(m1d || (m1d = {})); -var m1d = 1; +var m1d = 1;// error function m2() { } ; @@ -168,7 +168,7 @@ var m3 = (function () { function m3() { } return m3; -})(); +})();// ok since the module is not instantiated var m3a; (function (m3a) { var y = 2; @@ -179,7 +179,7 @@ var m3a = (function () { m3a.prototype.foo = function () { }; return m3a; -})(); +})();// error, class isn't ambient or declared before the module var m3b = (function () { function m3b() { } diff --git a/tests/baselines/reference/augmentedTypesModules3.js b/tests/baselines/reference/augmentedTypesModules3.js index b02116035ce..00f364be485 100644 --- a/tests/baselines/reference/augmentedTypesModules3.js +++ b/tests/baselines/reference/augmentedTypesModules3.js @@ -11,7 +11,7 @@ var m3 = (function () { function m3() { } return m3; -})(); +})();// ok since the module is not instantiated var m3a; (function (m3a) { var y = 2; @@ -22,4 +22,4 @@ var m3a = (function () { m3a.prototype.foo = function () { }; return m3a; -})(); +})();// error, class isn't ambient or declared before the module diff --git a/tests/baselines/reference/augmentedTypesVar.js b/tests/baselines/reference/augmentedTypesVar.js index 35586df4f39..d76526b9aa0 100644 --- a/tests/baselines/reference/augmentedTypesVar.js +++ b/tests/baselines/reference/augmentedTypesVar.js @@ -43,17 +43,17 @@ var x1 = 2; // var then function var x2 = 1; function x2() { -} +}// should be an error var x3 = 1; var x3 = function () { -}; +}// should be an error // should be an error ;// should be an error // var then class var x4 = 1; var x4 = (function () { function x4() { } return x4; -})(); +})();// error var x4a = 1; var x4a = (function () { function x4a() { @@ -61,22 +61,22 @@ var x4a = (function () { x4a.prototype.foo = function () { }; return x4a; -})(); +})();// error // var then enum var x5 = 1; var x5; (function (x5) { x5[x5["One"] = 0] = "One"; -})(x5 || (x5 = {})); +})(x5 || (x5 = {}));// error // var then module var x6 = 1; var x6a = 1; var x6a; (function (x6a) { var y = 2; -})(x6a || (x6a = {})); +})(x6a || (x6a = {}));// error since instantiated var x6b = 1; var x6b; (function (x6b) { x6b.y = 2; -})(x6b || (x6b = {})); +})(x6b || (x6b = {}));// error diff --git a/tests/baselines/reference/autonumberingInEnums.js b/tests/baselines/reference/autonumberingInEnums.js index 2d0bdc0282d..f9806e29c1b 100644 --- a/tests/baselines/reference/autonumberingInEnums.js +++ b/tests/baselines/reference/autonumberingInEnums.js @@ -14,5 +14,5 @@ var Foo; })(Foo || (Foo = {})); var Foo; (function (Foo) { - Foo[Foo["b"] = 0] = "b"; + Foo[Foo["b"] = 0] = "b";// should work fine })(Foo || (Foo = {})); diff --git a/tests/baselines/reference/avoid.js b/tests/baselines/reference/avoid.js index 45f4d52a7bc..44e18dd7b4e 100644 --- a/tests/baselines/reference/avoid.js +++ b/tests/baselines/reference/avoid.js @@ -23,8 +23,8 @@ var N=new f(); // ok with void fn function f() { var x = 1; } -var y = f(); -var why = f(); +var y = f();// error void fn +var why = f();// error void fn var w; w = f(); var C = (function () { @@ -34,5 +34,5 @@ var C = (function () { }; return C; })(); -var z = new C().g(); -var N = new f(); +var z = new C().g();// error void fn +var N = new f();// ok with void fn diff --git a/tests/baselines/reference/baseCheck.js b/tests/baselines/reference/baseCheck.js index 39eb8a312c9..701111672d8 100644 --- a/tests/baselines/reference/baseCheck.js +++ b/tests/baselines/reference/baseCheck.js @@ -65,7 +65,7 @@ var D = (function (_super) { this.z = z; } return D; -})(C); +})(C);// too few params var E = (function (_super) { __extends(E, _super); function E(z) { @@ -81,7 +81,7 @@ var F = (function (_super) { this.z = z; } return F; -})(C); +})(C);// first param type function f() { if (x < 10) { x = 11; diff --git a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js index f04f99d5fb3..d37bc85e2fd 100644 --- a/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js +++ b/tests/baselines/reference/bestCommonTypeOfConditionalExpressions.js @@ -61,18 +61,18 @@ var derived; var derived2; var r = true ? 1 : 2; var r3 = true ? 1 : {}; -var r4 = true ? a : b; -var r5 = true ? b : a; +var r4 = true ? a : b;// typeof a +var r5 = true ? b : a;// typeof b var r6 = true ? function (x) { } : function (x) { -}; +};// returns number => void var r7 = true ? function (x) { } : function (x) { }; var r8 = true ? function (x) { } : function (x) { -}; -var r10 = true ? derived : derived2; +};// returns Object => void +var r10 = true ? derived : derived2;// no error since we use the contextual type in BCT var r11 = true ? base : derived2; function foo5(t, u) { return true ? t : u; diff --git a/tests/baselines/reference/bestCommonTypeWithContextualTyping.js b/tests/baselines/reference/bestCommonTypeWithContextualTyping.js index 804ec075292..780b5c14966 100644 --- a/tests/baselines/reference/bestCommonTypeWithContextualTyping.js +++ b/tests/baselines/reference/bestCommonTypeWithContextualTyping.js @@ -25,7 +25,7 @@ var e; // All of these should pass. Neither type is a supertype of the other, but the RHS should // always use Ellement in these examples (not Contextual). Because Ellement is assignable // to Contextual, no errors. -var arr = [e]; -var obj = { s: e }; -var conditional = null ? e : e; -var contextualOr = e || e; +var arr = [e];// Ellement[] +var obj = { s: e };// { s: Ellement; [s: string]: Ellement } +var conditional = null ? e : e;// Ellement +var contextualOr = e || e;// Ellement diff --git a/tests/baselines/reference/bind1.js b/tests/baselines/reference/bind1.js index 2aa31265797..0e78a1826be 100644 --- a/tests/baselines/reference/bind1.js +++ b/tests/baselines/reference/bind1.js @@ -13,5 +13,5 @@ var M; } return C; })(); - M.C = C; + M.C = C;// this should be an unresolved symbol I error })(M || (M = {})); diff --git a/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.js b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.js index 9acb2fd1fb4..31ce264c4a1 100644 --- a/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.js +++ b/tests/baselines/reference/callExpressionWithTypeParameterConstrainedToOuterTypeParameter.js @@ -7,4 +7,4 @@ var y = i(""); // y should be string //// [callExpressionWithTypeParameterConstrainedToOuterTypeParameter.js] var i; -var y = i(""); +var y = i("");// y should be string diff --git a/tests/baselines/reference/callOnInstance.js b/tests/baselines/reference/callOnInstance.js index fae3108b080..b35d41ede46 100644 --- a/tests/baselines/reference/callOnInstance.js +++ b/tests/baselines/reference/callOnInstance.js @@ -11,6 +11,6 @@ declare class C { constructor(value: number); } (new C(1))(); // Error for calling an instance //// [callOnInstance.js] -var s1 = D(); +var s1 = D();// OK var s2 = (new D(1))(); (new C(1))(); diff --git a/tests/baselines/reference/callOverloads2.js b/tests/baselines/reference/callOverloads2.js index 2bffd50a2ab..ae6bb2ca19e 100644 --- a/tests/baselines/reference/callOverloads2.js +++ b/tests/baselines/reference/callOverloads2.js @@ -38,7 +38,7 @@ function F1(s) { } function F1(a) { return a; -} +}// error - duplicate identifier var f1 = new Foo("hey"); f1.bar1(); Foo(); diff --git a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.js b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.js index 7c742c1c323..1795c49f6da 100644 --- a/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.js +++ b/tests/baselines/reference/callSignatureWithoutAnnotationsOrBody.js @@ -23,7 +23,7 @@ var r5 = a.f(); // Call signatures without a return type annotation and function body return 'any' function foo(x) { } -var r = foo(1); +var r = foo(1);// void since there's a body var i; var r2 = i(); var r3 = i.f(); diff --git a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.js b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.js index fe6770ca933..3c6c15cb8a9 100644 --- a/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.js +++ b/tests/baselines/reference/callSignaturesThatDifferOnlyByReturnType2.js @@ -17,5 +17,5 @@ var r2 = x.foo(''); // error //// [callSignaturesThatDifferOnlyByReturnType2.js] var x; // BUG 822524 -var r = x.foo(1); -var r2 = x.foo(''); +var r = x.foo(1);// no error +var r2 = x.foo('');// error diff --git a/tests/baselines/reference/callbacksDontShareTypes.js b/tests/baselines/reference/callbacksDontShareTypes.js index f1e9865eee9..eee31b75628 100644 --- a/tests/baselines/reference/callbacksDontShareTypes.js +++ b/tests/baselines/reference/callbacksDontShareTypes.js @@ -27,7 +27,7 @@ var rf1 = function (x) { var r1a = _.map(c2, function (x) { return x.toFixed(); }); -var r1b = _.map(c2, rf1); +var r1b = _.map(c2, rf1);// this line should not cause the following 2 to have errors var r5a = _.map(c2, function (x) { return x.toFixed(); }); diff --git a/tests/baselines/reference/classAndVariableWithSameName.js b/tests/baselines/reference/classAndVariableWithSameName.js index 818123cf8f9..3a883a203d0 100644 --- a/tests/baselines/reference/classAndVariableWithSameName.js +++ b/tests/baselines/reference/classAndVariableWithSameName.js @@ -16,7 +16,7 @@ var C = (function () { } return C; })(); -var C = ''; +var C = '';// error var M; (function (M) { var D = (function () { @@ -24,5 +24,5 @@ var M; } return D; })(); - var D = 1; + var D = 1;// error })(M || (M = {})); diff --git a/tests/baselines/reference/classExtendsItself.js b/tests/baselines/reference/classExtendsItself.js index 126d88acd9a..ef2714d760c 100644 --- a/tests/baselines/reference/classExtendsItself.js +++ b/tests/baselines/reference/classExtendsItself.js @@ -18,18 +18,18 @@ var C = (function (_super) { _super.apply(this, arguments); } return C; -})(C); +})(C);// error var D = (function (_super) { __extends(D, _super); function D() { _super.apply(this, arguments); } return D; -})(D); +})(D);// error var E = (function (_super) { __extends(E, _super); function E() { _super.apply(this, arguments); } return E; -})(E); +})(E);// error diff --git a/tests/baselines/reference/classExtendsItselfIndirectly.js b/tests/baselines/reference/classExtendsItselfIndirectly.js index 584acb8bac6..04b37a77faa 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly.js @@ -24,7 +24,7 @@ var C = (function (_super) { _super.apply(this, arguments); } return C; -})(E); +})(E);// error var D = (function (_super) { __extends(D, _super); function D() { @@ -45,7 +45,7 @@ var C2 = (function (_super) { _super.apply(this, arguments); } return C2; -})(E2); +})(E2);// error var D2 = (function (_super) { __extends(D2, _super); function D2() { diff --git a/tests/baselines/reference/classExtendsItselfIndirectly2.js b/tests/baselines/reference/classExtendsItselfIndirectly2.js index d8932270253..0b8c4f6af87 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly2.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly2.js @@ -35,7 +35,7 @@ var C = (function (_super) { _super.apply(this, arguments); } return C; -})(N.E); +})(N.E);// error var M; (function (M) { var D = (function (_super) { @@ -66,7 +66,7 @@ var O; _super.apply(this, arguments); } return C2; - })(Q.E2); + })(Q.E2);// error var P; (function (P) { var D2 = (function (_super) { diff --git a/tests/baselines/reference/classExtendsItselfIndirectly3.js b/tests/baselines/reference/classExtendsItselfIndirectly3.js index 26c3a85ef51..dc9e63db133 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly3.js +++ b/tests/baselines/reference/classExtendsItselfIndirectly3.js @@ -31,7 +31,7 @@ var C = (function (_super) { _super.apply(this, arguments); } return C; -})(E); +})(E);// error //// [classExtendsItselfIndirectly_file2.js] var __extends = this.__extends || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; @@ -73,7 +73,7 @@ var C2 = (function (_super) { _super.apply(this, arguments); } return C2; -})(E2); +})(E2);// error //// [classExtendsItselfIndirectly_file5.js] var __extends = this.__extends || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; diff --git a/tests/baselines/reference/classExtendsValidConstructorFunction.js b/tests/baselines/reference/classExtendsValidConstructorFunction.js index 7de208a2614..cca5a983d40 100644 --- a/tests/baselines/reference/classExtendsValidConstructorFunction.js +++ b/tests/baselines/reference/classExtendsValidConstructorFunction.js @@ -14,11 +14,11 @@ var __extends = this.__extends || function (d, b) { }; function foo() { } -var x = new foo(); +var x = new foo();// can be used as a constructor function var C = (function (_super) { __extends(C, _super); function C() { _super.apply(this, arguments); } return C; -})(foo); +})(foo);// error, cannot extend it though diff --git a/tests/baselines/reference/classImplementsClass2.js b/tests/baselines/reference/classImplementsClass2.js index 0b4bb102403..ebcf00038bc 100644 --- a/tests/baselines/reference/classImplementsClass2.js +++ b/tests/baselines/reference/classImplementsClass2.js @@ -32,7 +32,7 @@ var C = (function () { function C() { } return C; -})(); +})();// error var C2 = (function (_super) { __extends(C2, _super); function C2() { diff --git a/tests/baselines/reference/classMemberInitializerScoping.js b/tests/baselines/reference/classMemberInitializerScoping.js index 70f562deb57..dbb04c176aa 100644 --- a/tests/baselines/reference/classMemberInitializerScoping.js +++ b/tests/baselines/reference/classMemberInitializerScoping.js @@ -27,7 +27,7 @@ var CCC = (function () { this.y = aaa; this.y = ''; } - CCC.staticY = aaa; + CCC.staticY = aaa;// This shouldnt be error return CCC; })(); // above is equivalent to this: diff --git a/tests/baselines/reference/classSideInheritance3.js b/tests/baselines/reference/classSideInheritance3.js index 0e226d9f417..27c8b58ee58 100644 --- a/tests/baselines/reference/classSideInheritance3.js +++ b/tests/baselines/reference/classSideInheritance3.js @@ -46,6 +46,6 @@ var C = (function (_super) { } return C; })(A); -var r1 = B; -var r2 = B; -var r3 = C; +var r1 = B;// error +var r2 = B;// error +var r3 = C;// ok diff --git a/tests/baselines/reference/classWithBaseClassButNoConstructor.js b/tests/baselines/reference/classWithBaseClassButNoConstructor.js index eff4b448034..253dc3783aa 100644 --- a/tests/baselines/reference/classWithBaseClassButNoConstructor.js +++ b/tests/baselines/reference/classWithBaseClassButNoConstructor.js @@ -60,8 +60,8 @@ var C = (function (_super) { return C; })(Base); var r = C; -var c = new C(); -var c2 = new C(1); +var c = new C();// error +var c2 = new C(1);// ok var Base2 = (function () { function Base2(x) { } @@ -75,8 +75,8 @@ var D = (function (_super) { return D; })(Base2); var r2 = D; -var d = new D(); -var d2 = new D(1); +var d = new D();// error +var d2 = new D(1);// ok // specialized base class var D2 = (function (_super) { __extends(D2, _super); @@ -86,8 +86,8 @@ var D2 = (function (_super) { return D2; })(Base2); var r3 = D2; -var d3 = new D(); -var d4 = new D(1); +var d3 = new D();// error +var d4 = new D(1);// ok var D3 = (function (_super) { __extends(D3, _super); function D3() { @@ -96,5 +96,5 @@ var D3 = (function (_super) { return D3; })(Base2); var r4 = D3; -var d5 = new D(); -var d6 = new D(1); +var d5 = new D();// error +var d6 = new D(1);// ok diff --git a/tests/baselines/reference/classWithConstructors.js b/tests/baselines/reference/classWithConstructors.js index baa4cd7d26a..a03c191cb90 100644 --- a/tests/baselines/reference/classWithConstructors.js +++ b/tests/baselines/reference/classWithConstructors.js @@ -63,16 +63,16 @@ var NonGeneric; } return C; })(); - var c = new C(); - var c2 = new C(''); + var c = new C();// error + var c2 = new C('');// ok var C2 = (function () { function C2(x) { } return C2; })(); - var c3 = new C2(); - var c4 = new C2(''); - var c5 = new C2(1); + var c3 = new C2();// error + var c4 = new C2('');// ok + var c5 = new C2(1);// ok var D = (function (_super) { __extends(D, _super); function D() { @@ -80,9 +80,9 @@ var NonGeneric; } return D; })(C2); - var d = new D(); - var d2 = new D(1); - var d3 = new D(''); + var d = new D();// error + var d2 = new D(1);// ok + var d3 = new D('');// ok })(NonGeneric || (NonGeneric = {})); var Generics; (function (Generics) { @@ -91,16 +91,16 @@ var Generics; } return C; })(); - var c = new C(); - var c2 = new C(''); + var c = new C();// error + var c2 = new C('');// ok var C2 = (function () { function C2(x) { } return C2; })(); - var c3 = new C2(); - var c4 = new C2(''); - var c5 = new C2(1, 2); + var c3 = new C2();// error + var c4 = new C2('');// ok + var c5 = new C2(1, 2);// ok var D = (function (_super) { __extends(D, _super); function D() { @@ -108,7 +108,7 @@ var Generics; } return D; })(C2); - var d = new D(); - var d2 = new D(1); - var d3 = new D(''); + var d = new D();// error + var d2 = new D(1);// ok + var d3 = new D('');// ok })(Generics || (Generics = {})); diff --git a/tests/baselines/reference/classWithoutExplicitConstructor.js b/tests/baselines/reference/classWithoutExplicitConstructor.js index b2574663fc2..520f2a58d3f 100644 --- a/tests/baselines/reference/classWithoutExplicitConstructor.js +++ b/tests/baselines/reference/classWithoutExplicitConstructor.js @@ -24,7 +24,7 @@ var C = (function () { return C; })(); var c = new C(); -var c2 = new C(null); +var c2 = new C(null);// error var D = (function () { function D() { this.x = 2; @@ -33,4 +33,4 @@ var D = (function () { return D; })(); var d = new D(); -var d2 = new D(null); +var d2 = new D(null);// error diff --git a/tests/baselines/reference/cloduleAcrossModuleDefinitions.js b/tests/baselines/reference/cloduleAcrossModuleDefinitions.js index 280e30c8c7d..d2efd8a6737 100644 --- a/tests/baselines/reference/cloduleAcrossModuleDefinitions.js +++ b/tests/baselines/reference/cloduleAcrossModuleDefinitions.js @@ -36,4 +36,4 @@ var A; })(A.B || (A.B = {})); var B = A.B; })(A || (A = {})); -var b; +var b;// ok diff --git a/tests/baselines/reference/cloduleTest2.js b/tests/baselines/reference/cloduleTest2.js index f2097ca9338..15cda15e292 100644 --- a/tests/baselines/reference/cloduleTest2.js +++ b/tests/baselines/reference/cloduleTest2.js @@ -43,7 +43,7 @@ var T1; (function (m3d) { m3d.y = 2; })(m3d || (m3d = {})); - var r = new m3d(); + var r = new m3d();// error })(T1 || (T1 = {})); var T2; (function (T2) { @@ -51,7 +51,7 @@ var T2; (function (m3d) { m3d.y = 2; })(m3d || (m3d = {})); - var r = new m3d(); + var r = new m3d();// error })(T2 || (T2 = {})); var T3; (function (T3) { @@ -79,5 +79,5 @@ var m3d; (function (m3d) { m3d.y = 2; })(m3d || (m3d = {})); -var r = new m3d(); -var r2 = new m4d(); +var r = new m3d();// error +var r2 = new m4d();// error diff --git a/tests/baselines/reference/collisionArgumentsArrowFunctions.js b/tests/baselines/reference/collisionArgumentsArrowFunctions.js index ba2777f47e2..2cb6df2a56b 100644 --- a/tests/baselines/reference/collisionArgumentsArrowFunctions.js +++ b/tests/baselines/reference/collisionArgumentsArrowFunctions.js @@ -22,25 +22,25 @@ var f1 = function (i) { for (var _i = 1; _i < arguments.length; _i++) { arguments[_i - 1] = arguments[_i]; } - var arguments; + var arguments;// no error }; var f12 = function (arguments) { var rest = []; for (var _i = 1; _i < arguments.length; _i++) { rest[_i - 1] = arguments[_i]; } - var arguments = 10; + var arguments = 10;// no error }; var f1NoError = function (arguments) { - var arguments = 10; + var arguments = 10;// no error }; var f2 = function () { var restParameters = []; for (var _i = 0; _i < arguments.length; _i++) { restParameters[_i - 0] = arguments[_i]; } - var arguments = 10; + var arguments = 10;// No Error }; var f2NoError = function () { - var arguments = 10; + var arguments = 10;// no error }; diff --git a/tests/baselines/reference/collisionArgumentsClassConstructor.js b/tests/baselines/reference/collisionArgumentsClassConstructor.js index 971af025942..76c3c25ff77 100644 --- a/tests/baselines/reference/collisionArgumentsClassConstructor.js +++ b/tests/baselines/reference/collisionArgumentsClassConstructor.js @@ -94,7 +94,7 @@ var c1 = (function () { for (var _i = 1; _i < arguments.length; _i++) { arguments[_i - 1] = arguments[_i]; } - var arguments; + var arguments;// no error } return c1; })(); @@ -104,13 +104,13 @@ var c12 = (function () { for (var _i = 1; _i < arguments.length; _i++) { rest[_i - 1] = arguments[_i]; } - var arguments = 10; + var arguments = 10;// no error } return c12; })(); var c1NoError = (function () { function c1NoError(arguments) { - var arguments = 10; + var arguments = 10;// no error } return c1NoError; })(); @@ -120,13 +120,13 @@ var c2 = (function () { for (var _i = 0; _i < arguments.length; _i++) { restParameters[_i - 0] = arguments[_i]; } - var arguments = 10; + var arguments = 10;// no error } return c2; })(); var c2NoError = (function () { function c2NoError() { - var arguments = 10; + var arguments = 10;// no error } return c2NoError; })(); @@ -137,14 +137,14 @@ var c3 = (function () { restParameters[_i - 1] = arguments[_i]; } this.arguments = arguments; - var arguments = 10; + var arguments = 10;// no error } return c3; })(); var c3NoError = (function () { function c3NoError(arguments) { this.arguments = arguments; - var arguments = 10; + var arguments = 10;// no error } return c3NoError; })(); @@ -154,7 +154,7 @@ var c5 = (function () { for (var _i = 1; _i < arguments.length; _i++) { arguments[_i - 1] = arguments[_i]; } - var arguments; + var arguments;// no error } return c5; })(); @@ -164,13 +164,13 @@ var c52 = (function () { for (var _i = 1; _i < arguments.length; _i++) { rest[_i - 1] = arguments[_i]; } - var arguments; + var arguments;// no error } return c52; })(); var c5NoError = (function () { function c5NoError(arguments) { - var arguments; + var arguments;// no error } return c5NoError; })(); diff --git a/tests/baselines/reference/collisionArgumentsClassMethod.js b/tests/baselines/reference/collisionArgumentsClassMethod.js index 0ca983b6587..323afbfd75e 100644 --- a/tests/baselines/reference/collisionArgumentsClassMethod.js +++ b/tests/baselines/reference/collisionArgumentsClassMethod.js @@ -57,34 +57,34 @@ var c1 = (function () { for (var _i = 1; _i < arguments.length; _i++) { arguments[_i - 1] = arguments[_i]; } - var arguments; + var arguments;// no error }; c1.prototype.foo1 = function (arguments) { var rest = []; for (var _i = 1; _i < arguments.length; _i++) { rest[_i - 1] = arguments[_i]; } - var arguments = 10; + var arguments = 10;// no error }; c1.prototype.fooNoError = function (arguments) { - var arguments = 10; + var arguments = 10;// no error }; c1.prototype.f4 = function (i) { var arguments = []; for (var _i = 1; _i < arguments.length; _i++) { arguments[_i - 1] = arguments[_i]; } - var arguments; + var arguments;// no error }; c1.prototype.f41 = function (arguments) { var rest = []; for (var _i = 1; _i < arguments.length; _i++) { rest[_i - 1] = arguments[_i]; } - var arguments; + var arguments;// no error }; c1.prototype.f4NoError = function (arguments) { - var arguments; + var arguments;// no error }; return c1; })(); @@ -96,10 +96,10 @@ var c3 = (function () { for (var _i = 0; _i < arguments.length; _i++) { restParameters[_i - 0] = arguments[_i]; } - var arguments = 10; + var arguments = 10;// no error }; c3.prototype.fooNoError = function () { - var arguments = 10; + var arguments = 10;// no error }; return c3; })(); diff --git a/tests/baselines/reference/collisionArgumentsFunction.js b/tests/baselines/reference/collisionArgumentsFunction.js index 6405a2bdc09..d869d854e1c 100644 --- a/tests/baselines/reference/collisionArgumentsFunction.js +++ b/tests/baselines/reference/collisionArgumentsFunction.js @@ -51,42 +51,42 @@ function f1(arguments) { for (var _i = 1; _i < arguments.length; _i++) { restParameters[_i - 1] = arguments[_i]; } - var arguments = 10; + var arguments = 10;// no error } function f12(i) { var arguments = []; for (var _i = 1; _i < arguments.length; _i++) { arguments[_i - 1] = arguments[_i]; } - var arguments; + var arguments;// no error } function f1NoError(arguments) { - var arguments = 10; + var arguments = 10;// no error } function f3() { var restParameters = []; for (var _i = 0; _i < arguments.length; _i++) { restParameters[_i - 0] = arguments[_i]; } - var arguments = 10; + var arguments = 10;// no error } function f3NoError() { - var arguments = 10; + var arguments = 10;// no error } function f4(arguments) { var rest = []; for (var _i = 1; _i < arguments.length; _i++) { rest[_i - 1] = arguments[_i]; } - var arguments; + var arguments;// No error } function f42(i) { var arguments = []; for (var _i = 1; _i < arguments.length; _i++) { arguments[_i - 1] = arguments[_i]; } - var arguments; + var arguments;// No error } function f4NoError(arguments) { - var arguments; + var arguments;// No error } diff --git a/tests/baselines/reference/collisionArgumentsFunctionExpressions.js b/tests/baselines/reference/collisionArgumentsFunctionExpressions.js index a57be35eab7..40c732d14e8 100644 --- a/tests/baselines/reference/collisionArgumentsFunctionExpressions.js +++ b/tests/baselines/reference/collisionArgumentsFunctionExpressions.js @@ -41,43 +41,43 @@ function foo() { for (var _i = 1; _i < arguments.length; _i++) { restParameters[_i - 1] = arguments[_i]; } - var arguments = 10; + var arguments = 10;// no error } function f12(i) { var arguments = []; for (var _i = 1; _i < arguments.length; _i++) { arguments[_i - 1] = arguments[_i]; } - var arguments; + var arguments;// no error } function f1NoError(arguments) { - var arguments = 10; + var arguments = 10;// no error } function f3() { var restParameters = []; for (var _i = 0; _i < arguments.length; _i++) { restParameters[_i - 0] = arguments[_i]; } - var arguments = 10; + var arguments = 10;// no error } function f3NoError() { - var arguments = 10; + var arguments = 10;// no error } function f4(arguments) { var rest = []; for (var _i = 1; _i < arguments.length; _i++) { rest[_i - 1] = arguments[_i]; } - var arguments; + var arguments;// No error } function f42(i) { var arguments = []; for (var _i = 1; _i < arguments.length; _i++) { arguments[_i - 1] = arguments[_i]; } - var arguments; + var arguments;// No error } function f4NoError(arguments) { - var arguments; + var arguments;// No error } } diff --git a/tests/baselines/reference/collisionArgumentsInType.js b/tests/baselines/reference/collisionArgumentsInType.js index 3047fd05fd6..826c264fc98 100644 --- a/tests/baselines/reference/collisionArgumentsInType.js +++ b/tests/baselines/reference/collisionArgumentsInType.js @@ -15,7 +15,7 @@ var v21: { } //// [collisionArgumentsInType.js] -var v1; -var v12; +var v1;// no error - no code gen +var v12;// no error - no code gen var v2; var v21; diff --git a/tests/baselines/reference/collisionRestParameterArrowFunctions.js b/tests/baselines/reference/collisionRestParameterArrowFunctions.js index d23ef5c1418..48040789e53 100644 --- a/tests/baselines/reference/collisionRestParameterArrowFunctions.js +++ b/tests/baselines/reference/collisionRestParameterArrowFunctions.js @@ -19,18 +19,18 @@ var f1 = function (_i) { for (var _i = 1; _i < arguments.length; _i++) { restParameters[_i - 1] = arguments[_i]; } - var _i = 10; + var _i = 10;// no error }; var f1NoError = function (_i) { - var _i = 10; + var _i = 10;// no error }; var f2 = function () { var restParameters = []; for (var _i = 0; _i < arguments.length; _i++) { restParameters[_i - 0] = arguments[_i]; } - var _i = 10; + var _i = 10;// No Error }; var f2NoError = function () { - var _i = 10; + var _i = 10;// no error }; diff --git a/tests/baselines/reference/collisionRestParameterClassConstructor.js b/tests/baselines/reference/collisionRestParameterClassConstructor.js index af25b4da658..86ffd7b4d76 100644 --- a/tests/baselines/reference/collisionRestParameterClassConstructor.js +++ b/tests/baselines/reference/collisionRestParameterClassConstructor.js @@ -74,13 +74,13 @@ var c1 = (function () { for (var _i = 1; _i < arguments.length; _i++) { restParameters[_i - 1] = arguments[_i]; } - var _i = 10; + var _i = 10;// no error } return c1; })(); var c1NoError = (function () { function c1NoError(_i) { - var _i = 10; + var _i = 10;// no error } return c1NoError; })(); @@ -90,13 +90,13 @@ var c2 = (function () { for (var _i = 0; _i < arguments.length; _i++) { restParameters[_i - 0] = arguments[_i]; } - var _i = 10; + var _i = 10;// no error } return c2; })(); var c2NoError = (function () { function c2NoError() { - var _i = 10; + var _i = 10;// no error } return c2NoError; })(); @@ -107,14 +107,14 @@ var c3 = (function () { restParameters[_i - 1] = arguments[_i]; } this._i = _i; - var _i = 10; + var _i = 10;// no error } return c3; })(); var c3NoError = (function () { function c3NoError(_i) { this._i = _i; - var _i = 10; + var _i = 10;// no error } return c3NoError; })(); @@ -124,13 +124,13 @@ var c5 = (function () { for (var _i = 1; _i < arguments.length; _i++) { rest[_i - 1] = arguments[_i]; } - var _i; + var _i;// no error } return c5; })(); var c5NoError = (function () { function c5NoError(_i) { - var _i; + var _i;// no error } return c5NoError; })(); diff --git a/tests/baselines/reference/collisionRestParameterClassMethod.js b/tests/baselines/reference/collisionRestParameterClassMethod.js index f5f4978472e..270c3af401d 100644 --- a/tests/baselines/reference/collisionRestParameterClassMethod.js +++ b/tests/baselines/reference/collisionRestParameterClassMethod.js @@ -47,20 +47,20 @@ var c1 = (function () { for (var _i = 1; _i < arguments.length; _i++) { restParameters[_i - 1] = arguments[_i]; } - var _i = 10; + var _i = 10;// no error }; c1.prototype.fooNoError = function (_i) { - var _i = 10; + var _i = 10;// no error }; c1.prototype.f4 = function (_i) { var rest = []; for (var _i = 1; _i < arguments.length; _i++) { rest[_i - 1] = arguments[_i]; } - var _i; + var _i;// no error }; c1.prototype.f4NoError = function (_i) { - var _i; + var _i;// no error }; return c1; })(); @@ -72,10 +72,10 @@ var c3 = (function () { for (var _i = 0; _i < arguments.length; _i++) { restParameters[_i - 0] = arguments[_i]; } - var _i = 10; + var _i = 10;// no error }; c3.prototype.fooNoError = function () { - var _i = 10; + var _i = 10;// no error }; return c3; })(); diff --git a/tests/baselines/reference/collisionRestParameterFunction.js b/tests/baselines/reference/collisionRestParameterFunction.js index a3287ca87d0..8efe4493b69 100644 --- a/tests/baselines/reference/collisionRestParameterFunction.js +++ b/tests/baselines/reference/collisionRestParameterFunction.js @@ -40,20 +40,20 @@ function f1(_i) { for (var _i = 1; _i < arguments.length; _i++) { restParameters[_i - 1] = arguments[_i]; } - var _i = 10; + var _i = 10;// no error } function f1NoError(_i) { - var _i = 10; + var _i = 10;// no error } function f3() { var restParameters = []; for (var _i = 0; _i < arguments.length; _i++) { restParameters[_i - 0] = arguments[_i]; } - var _i = 10; + var _i = 10;// no error } function f3NoError() { - var _i = 10; + var _i = 10;// no error } function f4(_i) { var rest = []; diff --git a/tests/baselines/reference/collisionRestParameterFunctionExpressions.js b/tests/baselines/reference/collisionRestParameterFunctionExpressions.js index fa50850ceef..3364a0ee022 100644 --- a/tests/baselines/reference/collisionRestParameterFunctionExpressions.js +++ b/tests/baselines/reference/collisionRestParameterFunctionExpressions.js @@ -31,20 +31,20 @@ function foo() { for (var _i = 1; _i < arguments.length; _i++) { restParameters[_i - 1] = arguments[_i]; } - var _i = 10; + var _i = 10;// no error } function f1NoError(_i) { - var _i = 10; + var _i = 10;// no error } function f3() { var restParameters = []; for (var _i = 0; _i < arguments.length; _i++) { restParameters[_i - 0] = arguments[_i]; } - var _i = 10; + var _i = 10;// no error } function f3NoError() { - var _i = 10; + var _i = 10;// no error } function f4(_i) { var rest = []; diff --git a/tests/baselines/reference/collisionRestParameterInType.js b/tests/baselines/reference/collisionRestParameterInType.js index 3910cbc490d..2f8665eb747 100644 --- a/tests/baselines/reference/collisionRestParameterInType.js +++ b/tests/baselines/reference/collisionRestParameterInType.js @@ -8,5 +8,5 @@ var v2: { } //// [collisionRestParameterInType.js] -var v1; +var v1;// no error - no code gen var v2; diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js index 926b310a83d..c15380695d8 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInConstructor.js @@ -27,10 +27,10 @@ var __extends = this.__extends || function (d, b) { __.prototype = b.prototype; d.prototype = new __(); }; -var _super = 10; +var _super = 10;// No Error var Foo = (function () { function Foo() { - var _super = 10; + var _super = 10;// No error } return Foo; })(); @@ -38,7 +38,7 @@ var b = (function (_super) { __extends(b, _super); function b() { _super.call(this); - var _super = 10; + var _super = 10;// Should be error } return b; })(Foo); @@ -47,7 +47,7 @@ var c = (function (_super) { function c() { _super.call(this); var x = function () { - var _super = 10; + var _super = 10;// Should be error }; } return c; diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js index e99c9235cc6..6d349439da2 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInMethod.js @@ -25,12 +25,12 @@ var __extends = this.__extends || function (d, b) { __.prototype = b.prototype; d.prototype = new __(); }; -var _super = 10; +var _super = 10;// No Error var Foo = (function () { function Foo() { } Foo.prototype.x = function () { - var _super = 10; + var _super = 10;// No error }; return Foo; })(); @@ -40,7 +40,7 @@ var b = (function (_super) { _super.apply(this, arguments); } b.prototype.foo = function () { - var _super = 10; + var _super = 10;// Should be error }; return b; })(Foo); @@ -51,7 +51,7 @@ var c = (function (_super) { } c.prototype.foo = function () { var x = function () { - var _super = 10; + var _super = 10;// Should be error }; }; return c; diff --git a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js index 7e3b8a5c5c3..527126391bf 100644 --- a/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js +++ b/tests/baselines/reference/collisionSuperAndLocalVarInProperty.js @@ -24,15 +24,15 @@ var __extends = this.__extends || function (d, b) { __.prototype = b.prototype; d.prototype = new __(); }; -var _super = 10; +var _super = 10;// No Error var Foo = (function () { function Foo() { this.prop1 = { doStuff: function () { - var _super = 10; + var _super = 10;// No error } }; - this._super = 10; + this._super = 10;// No error } return Foo; })(); @@ -42,10 +42,10 @@ var b = (function (_super) { _super.apply(this, arguments); this.prop2 = { doStuff: function () { - var _super = 10; + var _super = 10;// Should be error } }; - this._super = 10; + this._super = 10;// No error } return b; })(Foo); diff --git a/tests/baselines/reference/collisionSuperAndNameResolution.js b/tests/baselines/reference/collisionSuperAndNameResolution.js index 26633a6006e..749476d316a 100644 --- a/tests/baselines/reference/collisionSuperAndNameResolution.js +++ b/tests/baselines/reference/collisionSuperAndNameResolution.js @@ -19,7 +19,7 @@ var __extends = this.__extends || function (d, b) { d.prototype = new __(); }; var console; -var _super = 10; +var _super = 10;// No error var base = (function () { function base() { } diff --git a/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.js index 9ce9dd131a9..ef56e46b186 100644 --- a/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndAliasInGlobal.js @@ -12,4 +12,4 @@ var a; a.b = 10; })(a || (a = {})); var f = function () { return _this; }; -var _this = a; +var _this = a;// Error diff --git a/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.js b/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.js index 10238a55f47..e386021528b 100644 --- a/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.js +++ b/tests/baselines/reference/collisionThisExpressionAndAmbientClassInGlobal.js @@ -7,4 +7,4 @@ var a = new _this(); // Error //// [collisionThisExpressionAndAmbientClassInGlobal.js] var _this = this; var f = function () { return _this; }; -var a = new _this(); +var a = new _this();// Error diff --git a/tests/baselines/reference/collisionThisExpressionAndNameResolution.js b/tests/baselines/reference/collisionThisExpressionAndNameResolution.js index 969f3eff090..c2200d90cb2 100644 --- a/tests/baselines/reference/collisionThisExpressionAndNameResolution.js +++ b/tests/baselines/reference/collisionThisExpressionAndNameResolution.js @@ -18,7 +18,7 @@ var Foo = (function () { function Foo() { } Foo.prototype.x = function () { - var _this = 10; + var _this = 10;// Local var. No this capture in x(), so no conflict. function inner() { var _this = this; console.log(_this); diff --git a/tests/baselines/reference/collisionThisExpressionAndParameter.js b/tests/baselines/reference/collisionThisExpressionAndParameter.js index 7df383afcdf..4dc4b6618c6 100644 --- a/tests/baselines/reference/collisionThisExpressionAndParameter.js +++ b/tests/baselines/reference/collisionThisExpressionAndParameter.js @@ -98,7 +98,7 @@ var Foo = (function () { function Foo() { } Foo.prototype.x = function () { - var _this = 10; + var _this = 10;// Local var. No this capture in x(), so no conflict. function inner(_this) { var _this = this; return function (x) { return _this; }; @@ -117,7 +117,7 @@ var Foo = (function () { }; }; Foo.prototype.x1 = function () { - var _this = 10; + var _this = 10;// Local var. No this capture in x(), so no conflict. function inner(_this) { } }; diff --git a/tests/baselines/reference/commaOperatorOtherInvalidOperation.js b/tests/baselines/reference/commaOperatorOtherInvalidOperation.js index 467a45dcfd6..37c89a1de46 100644 --- a/tests/baselines/reference/commaOperatorOtherInvalidOperation.js +++ b/tests/baselines/reference/commaOperatorOtherInvalidOperation.js @@ -19,10 +19,10 @@ function foo1() { function foo(x, y) { return x, y; } -var resultIsString = foo(1, "123"); +var resultIsString = foo(1, "123");//error here //TypeParameters function foo1() { var x; var y; - var result = (x, y); + var result = (x, y);//error here } diff --git a/tests/baselines/reference/commentsEnums.js b/tests/baselines/reference/commentsEnums.js index 89a68d18308..7890b57e0ef 100644 --- a/tests/baselines/reference/commentsEnums.js +++ b/tests/baselines/reference/commentsEnums.js @@ -17,7 +17,7 @@ x = Colors.FancyPink; var Colors; (function (Colors) { /** Fancy name for 'blue'*/ - Colors[Colors["Cornflower"] = 0] = "Cornflower"; + Colors[Colors["Cornflower"] = 0] = "Cornflower";/* blue */ /** Fancy name for 'pink'*/ Colors[Colors["FancyPink"] = 1] = "FancyPink"; })(Colors || (Colors = {})); diff --git a/tests/baselines/reference/comparisonOperatorWithNoRelationshipPrimitiveType.js b/tests/baselines/reference/comparisonOperatorWithNoRelationshipPrimitiveType.js index 5c6e863b900..e03eaf17754 100644 --- a/tests/baselines/reference/comparisonOperatorWithNoRelationshipPrimitiveType.js +++ b/tests/baselines/reference/comparisonOperatorWithNoRelationshipPrimitiveType.js @@ -231,7 +231,7 @@ var e; var r1a1 = a < b; var r1a1 = a < c; var r1a1 = a < d; -var r1a1 = a < e; +var r1a1 = a < e;// no error, expected var r1b1 = b < a; var r1b1 = b < c; var r1b1 = b < d; @@ -244,7 +244,7 @@ var r1d1 = d < a; var r1d1 = d < b; var r1d1 = d < c; var r1d1 = d < e; -var r1e1 = e < a; +var r1e1 = e < a;// no error, expected var r1e1 = e < b; var r1e1 = e < c; var r1e1 = e < d; @@ -252,7 +252,7 @@ var r1e1 = e < d; var r2a1 = a > b; var r2a1 = a > c; var r2a1 = a > d; -var r2a1 = a > e; +var r2a1 = a > e;// no error, expected var r2b1 = b > a; var r2b1 = b > c; var r2b1 = b > d; @@ -265,7 +265,7 @@ var r2d1 = d > a; var r2d1 = d > b; var r2d1 = d > c; var r2d1 = d > e; -var r2e1 = e > a; +var r2e1 = e > a;// no error, expected var r2e1 = e > b; var r2e1 = e > c; var r2e1 = e > d; @@ -273,7 +273,7 @@ var r2e1 = e > d; var r3a1 = a <= b; var r3a1 = a <= c; var r3a1 = a <= d; -var r3a1 = a <= e; +var r3a1 = a <= e;// no error, expected var r3b1 = b <= a; var r3b1 = b <= c; var r3b1 = b <= d; @@ -286,7 +286,7 @@ var r3d1 = d <= a; var r3d1 = d <= b; var r3d1 = d <= c; var r3d1 = d <= e; -var r3e1 = e <= a; +var r3e1 = e <= a;// no error, expected var r3e1 = e <= b; var r3e1 = e <= c; var r3e1 = e <= d; @@ -294,7 +294,7 @@ var r3e1 = e <= d; var r4a1 = a >= b; var r4a1 = a >= c; var r4a1 = a >= d; -var r4a1 = a >= e; +var r4a1 = a >= e;// no error, expected var r4b1 = b >= a; var r4b1 = b >= c; var r4b1 = b >= d; @@ -307,7 +307,7 @@ var r4d1 = d >= a; var r4d1 = d >= b; var r4d1 = d >= c; var r4d1 = d >= e; -var r4e1 = e >= a; +var r4e1 = e >= a;// no error, expected var r4e1 = e >= b; var r4e1 = e >= c; var r4e1 = e >= d; @@ -315,7 +315,7 @@ var r4e1 = e >= d; var r5a1 = a == b; var r5a1 = a == c; var r5a1 = a == d; -var r5a1 = a == e; +var r5a1 = a == e;// no error, expected var r5b1 = b == a; var r5b1 = b == c; var r5b1 = b == d; @@ -328,7 +328,7 @@ var r5d1 = d == a; var r5d1 = d == b; var r5d1 = d == c; var r5d1 = d == e; -var r5e1 = e == a; +var r5e1 = e == a;// no error, expected var r5e1 = e == b; var r5e1 = e == c; var r5e1 = e == d; @@ -336,7 +336,7 @@ var r5e1 = e == d; var r6a1 = a != b; var r6a1 = a != c; var r6a1 = a != d; -var r6a1 = a != e; +var r6a1 = a != e;// no error, expected var r6b1 = b != a; var r6b1 = b != c; var r6b1 = b != d; @@ -349,7 +349,7 @@ var r6d1 = d != a; var r6d1 = d != b; var r6d1 = d != c; var r6d1 = d != e; -var r6e1 = e != a; +var r6e1 = e != a;// no error, expected var r6e1 = e != b; var r6e1 = e != c; var r6e1 = e != d; @@ -357,7 +357,7 @@ var r6e1 = e != d; var r7a1 = a === b; var r7a1 = a === c; var r7a1 = a === d; -var r7a1 = a === e; +var r7a1 = a === e;// no error, expected var r7b1 = b === a; var r7b1 = b === c; var r7b1 = b === d; @@ -370,7 +370,7 @@ var r7d1 = d === a; var r7d1 = d === b; var r7d1 = d === c; var r7d1 = d === e; -var r7e1 = e === a; +var r7e1 = e === a;// no error, expected var r7e1 = e === b; var r7e1 = e === c; var r7e1 = e === d; @@ -378,7 +378,7 @@ var r7e1 = e === d; var r8a1 = a !== b; var r8a1 = a !== c; var r8a1 = a !== d; -var r8a1 = a !== e; +var r8a1 = a !== e;// no error, expected var r8b1 = b !== a; var r8b1 = b !== c; var r8b1 = b !== d; @@ -391,7 +391,7 @@ var r8d1 = d !== a; var r8d1 = d !== b; var r8d1 = d !== c; var r8d1 = d !== e; -var r8e1 = e !== a; +var r8e1 = e !== a;// no error, expected var r8e1 = e !== b; var r8e1 = e !== c; var r8e1 = e !== d; diff --git a/tests/baselines/reference/conditionalExpression1.js b/tests/baselines/reference/conditionalExpression1.js index 92010908553..da59ef6c802 100644 --- a/tests/baselines/reference/conditionalExpression1.js +++ b/tests/baselines/reference/conditionalExpression1.js @@ -2,4 +2,4 @@ var x: boolean = (true ? 1 : ""); // should be an error //// [conditionalExpression1.js] -var x = (true ? 1 : ""); +var x = (true ? 1 : "");// should be an error diff --git a/tests/baselines/reference/constraints0.js b/tests/baselines/reference/constraints0.js index 17a71a92259..6d48eaabec0 100644 --- a/tests/baselines/reference/constraints0.js +++ b/tests/baselines/reference/constraints0.js @@ -17,6 +17,6 @@ var v2: C; // should not work var y = v1.x.a; // 'a' should be of type 'number' //// [constraints0.js] -var v1; -var v2; -var y = v1.x.a; +var v1;// should work +var v2;// should not work +var y = v1.x.a;// 'a' should be of type 'number' diff --git a/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.js b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.js index 61b6717966b..19fd896c388 100644 --- a/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.js +++ b/tests/baselines/reference/constraintsThatReferenceOtherContstraints1.js @@ -20,4 +20,4 @@ var Bar = (function () { } return Bar; })(); -var x; +var x;// Error 2 Type '{ a: string; b: number; }' does not satisfy the constraint 'T' for type diff --git a/tests/baselines/reference/constructorArgWithGenericCallSignature.js b/tests/baselines/reference/constructorArgWithGenericCallSignature.js index 90eada7cec4..e492ff90b17 100644 --- a/tests/baselines/reference/constructorArgWithGenericCallSignature.js +++ b/tests/baselines/reference/constructorArgWithGenericCallSignature.js @@ -29,4 +29,4 @@ var Test; })(Test || (Test = {})); var func; Test.F(func); -var test = new Test.MyClass(func); +var test = new Test.MyClass(func);// Should be OK diff --git a/tests/baselines/reference/constructorHasPrototypeProperty.js b/tests/baselines/reference/constructorHasPrototypeProperty.js index 2f0587255b2..7e5fc371807 100644 --- a/tests/baselines/reference/constructorHasPrototypeProperty.js +++ b/tests/baselines/reference/constructorHasPrototypeProperty.js @@ -71,8 +71,8 @@ var Generic; } return D; })(C); - var r = C.prototype; - var ra = r.foo; - var r2 = D.prototype; - var rb = r2.baz; + var r = C.prototype;// C + var ra = r.foo;// any + var r2 = D.prototype;// D + var rb = r2.baz;// any })(Generic || (Generic = {})); diff --git a/tests/baselines/reference/constructorParameterProperties.js b/tests/baselines/reference/constructorParameterProperties.js index 3c1bed9672a..adf8418f9bd 100644 --- a/tests/baselines/reference/constructorParameterProperties.js +++ b/tests/baselines/reference/constructorParameterProperties.js @@ -27,7 +27,7 @@ var C = (function () { })(); var c; var r = c.y; -var r2 = c.x; +var r2 = c.x;// error var D = (function () { function D(a, x) { this.x = x; @@ -36,5 +36,5 @@ var D = (function () { })(); var d; var r = d.y; -var r2 = d.x; -var r3 = d.a; +var r2 = d.x;// error +var r3 = d.a;// error diff --git a/tests/baselines/reference/constructorParameterProperties2.js b/tests/baselines/reference/constructorParameterProperties2.js index 50509b7b3af..28f5e645a64 100644 --- a/tests/baselines/reference/constructorParameterProperties2.js +++ b/tests/baselines/reference/constructorParameterProperties2.js @@ -26,7 +26,7 @@ var r3 = e.y; // error //// [constructorParameterProperties2.js] var C = (function () { function C(y) { - } + }// ok return C; })(); var c; @@ -34,7 +34,7 @@ var r = c.y; var D = (function () { function D(y) { this.y = y; - } + }// error return D; })(); var d; @@ -42,8 +42,8 @@ var r2 = d.y; var E = (function () { function E(y) { this.y = y; - } + }// error return E; })(); var e; -var r3 = e.y; +var r3 = e.y;// error diff --git a/tests/baselines/reference/constructorParameterShadowsOuterScopes.js b/tests/baselines/reference/constructorParameterShadowsOuterScopes.js index ffb2b3e6657..c068f50420a 100644 --- a/tests/baselines/reference/constructorParameterShadowsOuterScopes.js +++ b/tests/baselines/reference/constructorParameterShadowsOuterScopes.js @@ -28,7 +28,7 @@ class D { var x = 1; var C = (function () { function C(x) { - this.b = x; + this.b = x;// error, evaluated in scope of constructor, cannot reference x x = 2; } return C; @@ -36,7 +36,7 @@ var C = (function () { var y = 1; var D = (function () { function D(x) { - this.b = y; + this.b = y;// error, evaluated in scope of constructor, cannot reference y var y = ""; } return D; diff --git a/tests/baselines/reference/constructorsWithSpecializedSignatures.js b/tests/baselines/reference/constructorsWithSpecializedSignatures.js index f1c9a13cc75..3893728768a 100644 --- a/tests/baselines/reference/constructorsWithSpecializedSignatures.js +++ b/tests/baselines/reference/constructorsWithSpecializedSignatures.js @@ -53,6 +53,6 @@ var D = (function () { // overloads are ok var D2 = (function () { function D2(x) { - } + }// error return D2; })(); diff --git a/tests/baselines/reference/contextualSignatureInstantiation1.js b/tests/baselines/reference/contextualSignatureInstantiation1.js index ea83871d445..c0ea41b5a44 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation1.js +++ b/tests/baselines/reference/contextualSignatureInstantiation1.js @@ -9,6 +9,6 @@ var r100 = map2(e2); // type arg inference should fail for S since a generic lam //// [contextualSignatureInstantiation1.js] var e = function (x, y) { return x.length; }; -var r99 = map(e); +var r99 = map(e);// should be {}[] for S since a generic lambda is not inferentially typed var e2 = function (x, y) { return x.length; }; -var r100 = map2(e2); +var r100 = map2(e2);// type arg inference should fail for S since a generic lambda is not inferentially typed. Falls back to { length: number } diff --git a/tests/baselines/reference/contextualSignatureInstantiation3.js b/tests/baselines/reference/contextualSignatureInstantiation3.js index 6db26f49386..43b76bd1211 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation3.js +++ b/tests/baselines/reference/contextualSignatureInstantiation3.js @@ -36,8 +36,8 @@ function singleton(x) { var xs = [1, 2, 3]; // Have compiler check that we get the correct types var v1; -var v1 = xs.map(identity); -var v1 = map(xs, identity); +var v1 = xs.map(identity);// Error if not number[] +var v1 = map(xs, identity);// Error if not number[] var v2; -var v2 = xs.map(singleton); -var v2 = map(xs, singleton); +var v2 = xs.map(singleton);// Error if not number[][] +var v2 = map(xs, singleton);// Error if not number[][] diff --git a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.js b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.js index eb6213f381c..e8433486783 100644 --- a/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.js +++ b/tests/baselines/reference/contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.js @@ -14,4 +14,4 @@ function f() { return g; } var h; -var x = h("", f()); +var x = h("", f());// Call should succeed and x should be string. All type parameters should be instantiated to string diff --git a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js index fd9317cec94..1ca2745d52a 100644 --- a/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js +++ b/tests/baselines/reference/contextualTypingWithFixedTypeParameters1.js @@ -6,4 +6,4 @@ var r9 = f10('', () => (a => a.foo), 1); // now a should be any //// [contextualTypingWithFixedTypeParameters1.js] var f10; f10('', function () { return function (a) { return a.foo; }; }, ''); -var r9 = f10('', function () { return (function (a) { return a.foo; }); }, 1); +var r9 = f10('', function () { return (function (a) { return a.foo; }); }, 1);// now a should be any diff --git a/tests/baselines/reference/couldNotSelectGenericOverload.js b/tests/baselines/reference/couldNotSelectGenericOverload.js index 45b1d6d4558..e5ffd52af85 100644 --- a/tests/baselines/reference/couldNotSelectGenericOverload.js +++ b/tests/baselines/reference/couldNotSelectGenericOverload.js @@ -13,9 +13,9 @@ function makeArray(items) { return items; } var b = [1, ""]; -var b1G = makeArray(1, ""); -var b2G = makeArray(b); +var b1G = makeArray(1, "");// any, no error +var b2G = makeArray(b);// any[] function makeArray2(items) { return items; } -var b3G = makeArray2(1, ""); +var b3G = makeArray2(1, "");// error diff --git a/tests/baselines/reference/declFileInternalAliases.js b/tests/baselines/reference/declFileInternalAliases.js index c465644fcde..ca460a4c282 100644 --- a/tests/baselines/reference/declFileInternalAliases.js +++ b/tests/baselines/reference/declFileInternalAliases.js @@ -25,12 +25,12 @@ var m; var m1; (function (m1) { var x = m.c; - m1.d = new x(); + m1.d = new x();// emit the type as m.c })(m1 || (m1 = {})); var m2; (function (m2) { m2.x = m.c; - m2.d = new m2.x(); + m2.d = new m2.x();// emit the type as x })(m2 || (m2 = {})); diff --git a/tests/baselines/reference/declInput-2.js b/tests/baselines/reference/declInput-2.js index 011167d9a35..747c42cf17e 100644 --- a/tests/baselines/reference/declInput-2.js +++ b/tests/baselines/reference/declInput-2.js @@ -46,7 +46,7 @@ var M; }; D.prototype.m252 = function () { return null; - }; + };// don't generate D.prototype.m26 = function (i) { }; D.prototype.m262 = function (i) { diff --git a/tests/baselines/reference/declarationEmit_nameConflicts.js b/tests/baselines/reference/declarationEmit_nameConflicts.js index 941029774f4..19feee662e6 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts.js +++ b/tests/baselines/reference/declarationEmit_nameConflicts.js @@ -104,11 +104,11 @@ var M = exports.M; })(P.N || (P.N = {})); var N = P.N; P.im = M.P.f; - P.a = M.a; - P.b = M.b; - P.c = M.c; - P.g = M.c.g; - P.d = M.d; + P.a = M.a;// emitted incorrectly as typeof f + P.b = M.b;// ok + P.c = M.c;// ok + P.g = M.c.g;// ok + P.d = M.d;// emitted incorrectly as typeof im })(M.P || (M.P = {})); var P = M.P; })(exports.M || (exports.M = {})); diff --git a/tests/baselines/reference/declarationEmit_nameConflicts2.js b/tests/baselines/reference/declarationEmit_nameConflicts2.js index 79d73add32d..0c88e919cbe 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts2.js +++ b/tests/baselines/reference/declarationEmit_nameConflicts2.js @@ -46,10 +46,10 @@ var X; (function (Y) { (function (base) { (function (Z) { - Z.f = X.Y.base.f; - Z.C = X.Y.base.C; - Z.M = X.Y.base.M; - Z.E = X.Y.base.E; + Z.f = X.Y.base.f;// Should be base.f + Z.C = X.Y.base.C;// Should be base.C + Z.M = X.Y.base.M;// Should be base.M + Z.E = X.Y.base.E;// Should be base.E })(base.Z || (base.Z = {})); var Z = base.Z; })(Y.base || (Y.base = {})); diff --git a/tests/baselines/reference/declarationEmit_nameConflicts3.js b/tests/baselines/reference/declarationEmit_nameConflicts3.js index daa5bac83d7..bdc7c9aa6b6 100644 --- a/tests/baselines/reference/declarationEmit_nameConflicts3.js +++ b/tests/baselines/reference/declarationEmit_nameConflicts3.js @@ -77,10 +77,10 @@ var M; D[D["f"] = 0] = "f"; })(P.D || (P.D = {})); var D = P.D; - P.v; - P.w = M.D.f; - P.x = M.C.f; - P.x = M.E.f; + P.v;// ok + P.w = M.D.f;// error, should be typeof M.D.f + P.x = M.C.f;// error, should be typeof M.C.f + P.x = M.E.f;// error, should be typeof M.E.f })(M.P || (M.P = {})); var P = M.P; })(M || (M = {})); diff --git a/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.js b/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.js index 32ac2d47290..a29b4079b2b 100644 --- a/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.js +++ b/tests/baselines/reference/declarationEmit_nameConflictsWithAlias.js @@ -8,7 +8,7 @@ export module M { //// [declarationEmit_nameConflictsWithAlias.js] (function (M) { - M.w; + M.w;// Gets emitted as C.I, which is the wrong interface })(exports.M || (exports.M = {})); var M = exports.M; diff --git a/tests/baselines/reference/defaultArgsInFunctionExpressions.js b/tests/baselines/reference/defaultArgsInFunctionExpressions.js index 991c45d6973..da223251225 100644 --- a/tests/baselines/reference/defaultArgsInFunctionExpressions.js +++ b/tests/baselines/reference/defaultArgsInFunctionExpressions.js @@ -35,7 +35,7 @@ f7().x; var f = function (a) { if (a === void 0) { a = 3; } return a; -}; +};// Type should be (a?: number) => number var n = f(4); n = f(); var s = f(''); @@ -44,7 +44,7 @@ s = f(); var f2 = function (a) { if (a === void 0) { a = 3; } return a; -}; +};// Should error, but be of type (a: string) => string; s = f2(''); s = f2(); n = f2(); diff --git a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.js b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.js index 8924198b7dc..8b03f32dc8e 100644 --- a/tests/baselines/reference/defaultBestCommonTypesHaveDecls.js +++ b/tests/baselines/reference/defaultBestCommonTypesHaveDecls.js @@ -28,4 +28,4 @@ function concat(x, y) { return null; } var result = concat(1, ""); -var elementCount = result.length; +var elementCount = result.length;// would like to get an error by now diff --git a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js index 499c4fe8215..ce6f336b960 100644 --- a/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js +++ b/tests/baselines/reference/derivedClassConstructorWithoutSuperCall.js @@ -59,7 +59,7 @@ var Base2 = (function () { var Derived2 = (function (_super) { __extends(Derived2, _super); function Derived2() { - var r2 = function () { return _super.call(this); }; + var r2 = function () { return _super.call(this); };// error for misplaced super call (nested function) } return Derived2; })(Base2); @@ -68,14 +68,14 @@ var Derived3 = (function (_super) { function Derived3() { var r = function () { _super.call(this); - }; + }// error // error ;// error } return Derived3; })(Base2); var Derived4 = (function (_super) { __extends(Derived4, _super); function Derived4() { - var r = _super.call(this); + var r = _super.call(this);// ok } return Derived4; })(Base2); diff --git a/tests/baselines/reference/derivedClassTransitivity.js b/tests/baselines/reference/derivedClassTransitivity.js index af46f2d23c8..21c6397d4cb 100644 --- a/tests/baselines/reference/derivedClassTransitivity.js +++ b/tests/baselines/reference/derivedClassTransitivity.js @@ -41,7 +41,7 @@ var D = (function (_super) { _super.apply(this, arguments); } D.prototype.foo = function () { - }; + };// ok to drop parameters return D; })(C); var E = (function (_super) { @@ -50,7 +50,7 @@ var E = (function (_super) { _super.apply(this, arguments); } E.prototype.foo = function (x) { - }; + };// ok to add optional parameters return E; })(D); var c; diff --git a/tests/baselines/reference/derivedClassTransitivity2.js b/tests/baselines/reference/derivedClassTransitivity2.js index a4d2cf8b421..56985a31094 100644 --- a/tests/baselines/reference/derivedClassTransitivity2.js +++ b/tests/baselines/reference/derivedClassTransitivity2.js @@ -41,7 +41,7 @@ var D = (function (_super) { _super.apply(this, arguments); } D.prototype.foo = function (x) { - }; + };// ok to drop parameters return D; })(C); var E = (function (_super) { @@ -50,7 +50,7 @@ var E = (function (_super) { _super.apply(this, arguments); } E.prototype.foo = function (x, y) { - }; + };// ok to add optional parameters return E; })(D); var c; diff --git a/tests/baselines/reference/derivedClassTransitivity3.js b/tests/baselines/reference/derivedClassTransitivity3.js index a20136f4b25..fe7618f36e5 100644 --- a/tests/baselines/reference/derivedClassTransitivity3.js +++ b/tests/baselines/reference/derivedClassTransitivity3.js @@ -41,7 +41,7 @@ var D = (function (_super) { _super.apply(this, arguments); } D.prototype.foo = function (x) { - }; + };// ok to drop parameters return D; })(C); var E = (function (_super) { @@ -50,7 +50,7 @@ var E = (function (_super) { _super.apply(this, arguments); } E.prototype.foo = function (x, y) { - }; + };// ok to add optional parameters return E; })(D); var c; diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js index 5b9068256a9..fdfaa93a41e 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor.js @@ -48,7 +48,7 @@ var Derived = (function (_super) { } return Derived; })(Base); -var r = new Derived(); +var r = new Derived();// error var r2 = new Derived(1); var Base2 = (function () { function Base2(x) { @@ -65,5 +65,5 @@ var D = (function (_super) { } return D; })(Base2); -var d = new D(); -var d2 = new D(new Date()); +var d = new D();// error +var d2 = new D(new Date());// ok diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js index 06ca55acb3e..5f6d6f88b0b 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor2.js @@ -56,7 +56,7 @@ var Derived = (function (_super) { } return Derived; })(Base); -var r = new Derived(); +var r = new Derived();// error var r2 = new Derived(1); var r3 = new Derived(1, 2); var r4 = new Derived(1, 2, 3); @@ -75,7 +75,7 @@ var D = (function (_super) { } return D; })(Base2); -var d = new D(); -var d2 = new D(new Date()); +var d = new D();// error +var d2 = new D(new Date());// ok var d3 = new D(new Date(), new Date()); var d4 = new D(new Date(), new Date(), new Date()); diff --git a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js index 3037443e5af..7a08caf6126 100644 --- a/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js +++ b/tests/baselines/reference/derivedClassWithoutExplicitConstructor3.js @@ -79,8 +79,8 @@ var Derived2 = (function (_super) { } return Derived2; })(Derived); -var r = new Derived(); -var r2 = new Derived2(1); +var r = new Derived();// error +var r2 = new Derived2(1);// error var r3 = new Derived('', ''); var Base2 = (function () { function Base2(x) { @@ -106,6 +106,6 @@ var D2 = (function (_super) { } return D2; })(D); -var d = new D2(); -var d2 = new D2(new Date()); -var d3 = new D2(new Date(), new Date()); +var d = new D2();// error +var d2 = new D2(new Date());// error +var d3 = new D2(new Date(), new Date());// ok diff --git a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js index 7873bf11c3e..cb6e7e83e4a 100644 --- a/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js +++ b/tests/baselines/reference/derivedTypeAccessesHiddenBaseCallViaSuperPropertyAccess.js @@ -41,9 +41,9 @@ var Derived = (function (_super) { return null; }; Derived.prototype.bar = function () { - var r = _super.prototype.foo.call(this, { a: 1 }); - var r2 = _super.prototype.foo.call(this, { a: 1, b: 2 }); - var r3 = this.foo({ a: 1, b: 2 }); + var r = _super.prototype.foo.call(this, { a: 1 });// { a: number } + var r2 = _super.prototype.foo.call(this, { a: 1, b: 2 });// { a: number } + var r3 = this.foo({ a: 1, b: 2 });// { a: number; b: number; } }; return Derived; })(Base); diff --git a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.js b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.js index 07fa97fae79..92db09c94cf 100644 --- a/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.js +++ b/tests/baselines/reference/doNotWidenAtObjectLiteralPropertyAssignment.js @@ -12,4 +12,4 @@ var test: IIntervalTreeNode[] = [{ interval: { begin: 0 }, children: null }]; // //// [doNotWidenAtObjectLiteralPropertyAssignment.js] -var test = [{ interval: { begin: 0 }, children: null }]; +var test = [{ interval: { begin: 0 }, children: null }];// was error here because best common type is {} diff --git a/tests/baselines/reference/dottedSymbolResolution1.js b/tests/baselines/reference/dottedSymbolResolution1.js index 369d9336d9f..aafaf45c496 100644 --- a/tests/baselines/reference/dottedSymbolResolution1.js +++ b/tests/baselines/reference/dottedSymbolResolution1.js @@ -39,6 +39,6 @@ function each(collection, callback) { function _setBarAndText() { var x, $; each(x.find(" "), function () { - var $this = $(''), thisBar = $this.find(".fx-usagebars-calloutbar-this"); + var $this = $(''), thisBar = $this.find(".fx-usagebars-calloutbar-this");// bug lead to 'could not find dotted symbol' here }); } diff --git a/tests/baselines/reference/duplicateIdentifierInCatchBlock.js b/tests/baselines/reference/duplicateIdentifierInCatchBlock.js index b961fa64df6..d788b72efbf 100644 --- a/tests/baselines/reference/duplicateIdentifierInCatchBlock.js +++ b/tests/baselines/reference/duplicateIdentifierInCatchBlock.js @@ -37,9 +37,9 @@ try { catch (e) { var x; function x() { - } + }// error function e() { - } - var p; + }// error var p; + var p;// error } diff --git a/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js b/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js index c2529b2e037..4f936e528e6 100644 --- a/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js +++ b/tests/baselines/reference/duplicateIdentifiersAcrossContainerBoundaries.js @@ -60,7 +60,7 @@ var M; } return I; })(); - M.I = I; + M.I = I;// error })(M || (M = {})); var M; (function (M) { @@ -75,7 +75,7 @@ var M; } return f; })(); - M.f = f; + M.f = f;// error })(M || (M = {})); var M; (function (M) { @@ -89,7 +89,7 @@ var M; } return g; })(); - M.g = g; + M.g = g;// no error })(M || (M = {})); var M; (function (M) { @@ -103,7 +103,7 @@ var M; var M; (function (M) { function C() { - } + }// no error })(M || (M = {})); var M; (function (M) { @@ -111,7 +111,7 @@ var M; })(M || (M = {})); var M; (function (M) { - M.v = 3; + M.v = 3;// error for redeclaring var in a different parent })(M || (M = {})); var Foo = (function () { function Foo() { @@ -120,7 +120,7 @@ var Foo = (function () { })(); var Foo; (function (Foo) { - Foo.x; + Foo.x;// error for redeclaring var in a different parent })(Foo || (Foo = {})); var N; (function (N) { diff --git a/tests/baselines/reference/duplicateSymbolsExportMatching.js b/tests/baselines/reference/duplicateSymbolsExportMatching.js index f3dd4a8351c..8a5c8873b4a 100644 --- a/tests/baselines/reference/duplicateSymbolsExportMatching.js +++ b/tests/baselines/reference/duplicateSymbolsExportMatching.js @@ -83,9 +83,9 @@ define(["require", "exports"], function (require, exports) { var M2; (function (M2) { var v; - M2.v; + M2.v;// one error (visibility) var w; - M2.w; + M2.w;// two errors (visibility and type mismatch) })(M2 || (M2 = {})); var M; (function (M) { @@ -95,7 +95,7 @@ define(["require", "exports"], function (require, exports) { })(F || (F = {})); function F() { } - M.F = F; + M.F = F;// Only one error for duplicate identifier (don't consider visibility) })(M || (M = {})); var M; (function (M) { diff --git a/tests/baselines/reference/duplicateVariablesWithAny.js b/tests/baselines/reference/duplicateVariablesWithAny.js index c21bef01770..3afaa87e63f 100644 --- a/tests/baselines/reference/duplicateVariablesWithAny.js +++ b/tests/baselines/reference/duplicateVariablesWithAny.js @@ -20,15 +20,15 @@ var z; // ok //// [duplicateVariablesWithAny.js] // They should have to be the same even when one of the types is 'any' var x; -var x = 2; +var x = 2;//error var y = ""; -var y; +var y;//error var N; (function (N) { var x; - var x = 2; + var x = 2;//error var y = ""; - var y; + var y;//error })(N || (N = {})); var z; -var z; +var z;// ok diff --git a/tests/baselines/reference/emptyIndexer.js b/tests/baselines/reference/emptyIndexer.js index 8e3abd0cab4..bca45065588 100644 --- a/tests/baselines/reference/emptyIndexer.js +++ b/tests/baselines/reference/emptyIndexer.js @@ -14,4 +14,4 @@ var n = x[''].m(); // should not crash compiler //// [emptyIndexer.js] var x; -var n = x[''].m(); +var n = x[''].m();// should not crash compiler diff --git a/tests/baselines/reference/enumAssignability.js b/tests/baselines/reference/enumAssignability.js index f602829eaf8..635252161e3 100644 --- a/tests/baselines/reference/enumAssignability.js +++ b/tests/baselines/reference/enumAssignability.js @@ -70,11 +70,11 @@ e = f; f = e; e = 1; f = 1; -var x = e; +var x = e;// ok x = f; var Others; (function (Others) { - var a = e; + var a = e;// ok var C = (function () { function C() { } @@ -82,11 +82,11 @@ var Others; })(); var ac; var ai; - var b = e; + var b = e;// ok var c = e; var d = e; var ee = e; - var f = e; + var f = e;// ok var g = e; var h = e; var i = e; diff --git a/tests/baselines/reference/enumAssignabilityInInheritance.js b/tests/baselines/reference/enumAssignabilityInInheritance.js index 5d44c28bde9..0b4b10117d5 100644 --- a/tests/baselines/reference/enumAssignabilityInInheritance.js +++ b/tests/baselines/reference/enumAssignabilityInInheritance.js @@ -115,9 +115,9 @@ var E; (function (E) { E[E["A"] = 0] = "A"; })(E || (E = {})); -var r = foo(0 /* A */); -var r2 = foo(1); -var r3 = foo(null); +var r = foo(0 /* A */);// E +var r2 = foo(1);// number +var r3 = foo(null);// any var r4 = foo2(0 /* A */); var r4 = foo3(0 /* A */); var r4 = foo4(0 /* A */); diff --git a/tests/baselines/reference/enumAssignmentCompat.js b/tests/baselines/reference/enumAssignmentCompat.js index f7fb01ff69c..b3abf80d146 100644 --- a/tests/baselines/reference/enumAssignmentCompat.js +++ b/tests/baselines/reference/enumAssignmentCompat.js @@ -56,14 +56,14 @@ var W; })(W || (W = {})); var x = W; var y = W; -var z = W; +var z = W;// error var a = 0 /* a */; -var b = 0 /* a */; +var b = 0 /* a */;// error var c = 0 /* a */; -var d = 3; +var d = 3;// error var e = 4; -var f = 0 /* a */; -var g = 5; +var f = 0 /* a */;// error +var g = 5;// error var h = 3; var i = 0 /* a */; i = 0 /* a */; diff --git a/tests/baselines/reference/enumAssignmentCompat2.js b/tests/baselines/reference/enumAssignmentCompat2.js index 41ac87e1587..e066633c9a2 100644 --- a/tests/baselines/reference/enumAssignmentCompat2.js +++ b/tests/baselines/reference/enumAssignmentCompat2.js @@ -55,14 +55,14 @@ var W; })(W || (W = {})); var x = W; var y = W; -var z = W; +var z = W;// error var a = 0 /* a */; -var b = 0 /* a */; +var b = 0 /* a */;// error var c = 0 /* a */; -var d = 3; +var d = 3;// error var e = 4; -var f = 0 /* a */; -var g = 5; +var f = 0 /* a */;// error +var g = 5;// error var h = 3; var i = 0 /* a */; i = 0 /* a */; diff --git a/tests/baselines/reference/enumBasics.js b/tests/baselines/reference/enumBasics.js index 45a393be502..a9d593e5502 100644 --- a/tests/baselines/reference/enumBasics.js +++ b/tests/baselines/reference/enumBasics.js @@ -123,13 +123,13 @@ var E5; (function (E5) { E5[E5["A"] = 0] = "A"; E5[E5["B"] = 3] = "B"; - E5[E5["C"] = 4] = "C"; + E5[E5["C"] = 4] = "C";// 4 })(E5 || (E5 = {})); var E6; (function (E6) { E6[E6["A"] = 0] = "A"; E6[E6["B"] = 0] = "B"; - E6[E6["C"] = 1] = "C"; + E6[E6["C"] = 1] = "C";// 1 })(E6 || (E6 = {})); // Enum with computed member initializer of type 'any' var E7; diff --git a/tests/baselines/reference/enumIndexer.js b/tests/baselines/reference/enumIndexer.js index b2b72441211..161214ecf20 100644 --- a/tests/baselines/reference/enumIndexer.js +++ b/tests/baselines/reference/enumIndexer.js @@ -15,4 +15,4 @@ var MyEnumType; })(MyEnumType || (MyEnumType = {})); var _arr = [{ key: 'foo' }, { key: 'bar' }]; var enumValue = 0 /* foo */; -var x = _arr.map(function (o) { return MyEnumType[o.key] === enumValue; }); +var x = _arr.map(function (o) { return MyEnumType[o.key] === enumValue; });// these are not same type diff --git a/tests/baselines/reference/enumNumbering1.js b/tests/baselines/reference/enumNumbering1.js index 40bf821a088..ca4d03f75f2 100644 --- a/tests/baselines/reference/enumNumbering1.js +++ b/tests/baselines/reference/enumNumbering1.js @@ -15,5 +15,5 @@ var Test; Test[Test["B"] = 1] = "B"; Test[Test["C"] = Math.floor(Math.random() * 1000)] = "C"; Test[Test["D"] = 10] = "D"; - Test[Test["E"] = 11] = "E"; + Test[Test["E"] = 11] = "E";// Error but shouldn't be })(Test || (Test = {})); diff --git a/tests/baselines/reference/enumPropertyAccess.js b/tests/baselines/reference/enumPropertyAccess.js index c0346dc547c..5001dc75264 100644 --- a/tests/baselines/reference/enumPropertyAccess.js +++ b/tests/baselines/reference/enumPropertyAccess.js @@ -20,8 +20,8 @@ var Colors; Colors[Colors["Red"] = 0] = "Red"; Colors[Colors["Green"] = 1] = "Green"; })(Colors || (Colors = {})); -var x = 0 /* Red */; -var p = x.Green; +var x = 0 /* Red */;// type of 'x' should be 'Colors' +var p = x.Green;// error x.toFixed(); // Now with generics function fill(f) { diff --git a/tests/baselines/reference/errorOnContextuallyTypedReturnType.js b/tests/baselines/reference/errorOnContextuallyTypedReturnType.js index 45e92ab5099..d8ad349e02f 100644 --- a/tests/baselines/reference/errorOnContextuallyTypedReturnType.js +++ b/tests/baselines/reference/errorOnContextuallyTypedReturnType.js @@ -5,6 +5,6 @@ var n2: () => boolean = function ():boolean { }; // expect an error here //// [errorOnContextuallyTypedReturnType.js] var n1 = function () { -}; +};// expect an error here var n2 = function () { -}; +};// expect an error here diff --git a/tests/baselines/reference/es6MemberScoping.js b/tests/baselines/reference/es6MemberScoping.js index 6cfdef9e743..f5c5ddf8d19 100644 --- a/tests/baselines/reference/es6MemberScoping.js +++ b/tests/baselines/reference/es6MemberScoping.js @@ -20,7 +20,7 @@ class Foo2 { //// [es6MemberScoping.js] var Foo = (function () { function Foo(store) { - this._store = store; + this._store = store;// should be an error. } Foo.prototype.foo = function () { return this._store.length; @@ -32,6 +32,6 @@ var Foo2 = (function () { } Foo2.Foo2 = function () { return 0; - }; + };// should not be an error return Foo2; })(); diff --git a/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.js b/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.js index 71ca42ca9de..c25204f7156 100644 --- a/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.js +++ b/tests/baselines/reference/exportAssignedTypeAsTypeAnnotation.js @@ -19,5 +19,5 @@ define(["require", "exports"], function (require, exports) { }); //// [exportAssignedTypeAsTypeAnnotation_1.js] define(["require", "exports"], function (require, exports) { - var t2; + var t2;// should not raise a 'container type' error }); diff --git a/tests/baselines/reference/exportAssignmentConstrainedGenericType.js b/tests/baselines/reference/exportAssignmentConstrainedGenericType.js index b7223d84f59..6a1c6414754 100644 --- a/tests/baselines/reference/exportAssignmentConstrainedGenericType.js +++ b/tests/baselines/reference/exportAssignmentConstrainedGenericType.js @@ -23,6 +23,6 @@ var Foo = (function () { module.exports = Foo; //// [foo_1.js] var foo = require("./foo_0"); -var x = new foo(true); -var y = new foo({ a: "test", b: 42 }); +var x = new foo(true);// Should error +var y = new foo({ a: "test", b: 42 });// Should be OK var z = y.test.b; diff --git a/tests/baselines/reference/exportAssignmentOfDeclaredExternalModule.js b/tests/baselines/reference/exportAssignmentOfDeclaredExternalModule.js index 3a6f9022f77..5e7a2ceec90 100644 --- a/tests/baselines/reference/exportAssignmentOfDeclaredExternalModule.js +++ b/tests/baselines/reference/exportAssignmentOfDeclaredExternalModule.js @@ -18,8 +18,8 @@ var b = z(); // call signature - no error //// [exportAssignmentOfDeclaredExternalModule_0.js] //// [exportAssignmentOfDeclaredExternalModule_1.js] -var x = new Sammy(); -var y = Sammy(); -var z; -var a = new z(); -var b = z(); +var x = new Sammy();// error to use as constructor as there is not constructor symbol +var y = Sammy();// error to use interface name as call target +var z;// no error - z is of type interface Sammy from module 'M' +var a = new z();// constructor - no error +var b = z();// call signature - no error diff --git a/tests/baselines/reference/exportPrivateType.js b/tests/baselines/reference/exportPrivateType.js index ad34855a97b..5f638f3a05e 100644 --- a/tests/baselines/reference/exportPrivateType.js +++ b/tests/baselines/reference/exportPrivateType.js @@ -52,4 +52,4 @@ var foo; foo.g; foo.h; })(foo || (foo = {})); -var y = foo.g; +var y = foo.g;// Exported variable 'y' has or is using private type 'foo.C2'. diff --git a/tests/baselines/reference/extendNonClassSymbol1.js b/tests/baselines/reference/extendNonClassSymbol1.js index cb1f6f82419..e72524fdf1a 100644 --- a/tests/baselines/reference/extendNonClassSymbol1.js +++ b/tests/baselines/reference/extendNonClassSymbol1.js @@ -24,4 +24,4 @@ var C = (function (_super) { _super.apply(this, arguments); } return C; -})(x); +})(x);// error, could not find symbol xs diff --git a/tests/baselines/reference/extendNonClassSymbol2.js b/tests/baselines/reference/extendNonClassSymbol2.js index 7321df4cd88..a0b7b1cc42d 100644 --- a/tests/baselines/reference/extendNonClassSymbol2.js +++ b/tests/baselines/reference/extendNonClassSymbol2.js @@ -15,11 +15,11 @@ var __extends = this.__extends || function (d, b) { function Foo() { this.x = 1; } -var x = new Foo(); +var x = new Foo();// legal, considered a constructor function var C = (function (_super) { __extends(C, _super); function C() { _super.apply(this, arguments); } return C; -})(Foo); +})(Foo);// error, could not find symbol Foo diff --git a/tests/baselines/reference/externalModuleExportingGenericClass.js b/tests/baselines/reference/externalModuleExportingGenericClass.js index 80e4f7bc66c..de803d0c59a 100644 --- a/tests/baselines/reference/externalModuleExportingGenericClass.js +++ b/tests/baselines/reference/externalModuleExportingGenericClass.js @@ -24,6 +24,6 @@ var C = (function () { module.exports = C; //// [externalModuleExportingGenericClass_file1.js] var a = require('externalModuleExportingGenericClass_file0'); -var v; +var v;// this should report error var v2 = (new a()).foo; var v3 = (new a()).foo; diff --git a/tests/baselines/reference/funClodule.js b/tests/baselines/reference/funClodule.js index c4b7d6e7a26..6f3818e2312 100644 --- a/tests/baselines/reference/funClodule.js +++ b/tests/baselines/reference/funClodule.js @@ -32,4 +32,4 @@ var foo3 = (function () { function foo3() { } return foo3; -})(); +})();// Should error diff --git a/tests/baselines/reference/functionConstraintSatisfaction2.js b/tests/baselines/reference/functionConstraintSatisfaction2.js index c5ea8106b12..ee31f41f977 100644 --- a/tests/baselines/reference/functionConstraintSatisfaction2.js +++ b/tests/baselines/reference/functionConstraintSatisfaction2.js @@ -69,7 +69,7 @@ var r = foo2(new Function()); var r2 = foo2(function (x) { return x; }); var r6 = foo2(C); var r7 = foo2(b); -var r8 = foo2(function (x) { return x; }); +var r8 = foo2(function (x) { return x; });// no error expected var r11 = foo2(function (x, y) { return x; }); var r13 = foo2(C2); var r14 = foo2(b2); diff --git a/tests/baselines/reference/functionSignatureAssignmentCompat1.js b/tests/baselines/reference/functionSignatureAssignmentCompat1.js index 413f78ca9fa..49649633b96 100644 --- a/tests/baselines/reference/functionSignatureAssignmentCompat1.js +++ b/tests/baselines/reference/functionSignatureAssignmentCompat1.js @@ -13,6 +13,6 @@ var e: ParserFunc = parsers.readline(); // ok //// [functionSignatureAssignmentCompat1.js] var parsers; -var c = parsers.raw; -var d = parsers.readline; -var e = parsers.readline(); +var c = parsers.raw;// ok! +var d = parsers.readline;// not ok +var e = parsers.readline();// ok diff --git a/tests/baselines/reference/funduleUsedAcrossFileBoundary.js b/tests/baselines/reference/funduleUsedAcrossFileBoundary.js index e2fe34248d8..00d4ce77f45 100644 --- a/tests/baselines/reference/funduleUsedAcrossFileBoundary.js +++ b/tests/baselines/reference/funduleUsedAcrossFileBoundary.js @@ -17,5 +17,5 @@ function promiseWithCancellation(promise: Q.Promise) { //// [funduleUsedAcrossFileBoundary_file1.js] //// [funduleUsedAcrossFileBoundary_file2.js] function promiseWithCancellation(promise) { - var deferred = Q.defer(); + var deferred = Q.defer();// used to be an error } diff --git a/tests/baselines/reference/genericArrayAssignmentCompatErrors.js b/tests/baselines/reference/genericArrayAssignmentCompatErrors.js index 57dac3cd6f2..100344d1b8c 100644 --- a/tests/baselines/reference/genericArrayAssignmentCompatErrors.js +++ b/tests/baselines/reference/genericArrayAssignmentCompatErrors.js @@ -25,7 +25,7 @@ myCars3 = myCars5; var myCars = new Array(); var myCars2 = new []; var myCars3 = new Array({}); -var myCars4; +var myCars4;// error var myCars5; myCars = myCars2; myCars = myCars3; diff --git a/tests/baselines/reference/genericArrayMethods1.js b/tests/baselines/reference/genericArrayMethods1.js index c8f3e3a46c6..742d9c24eeb 100644 --- a/tests/baselines/reference/genericArrayMethods1.js +++ b/tests/baselines/reference/genericArrayMethods1.js @@ -3,4 +3,4 @@ var x:string[] = [0,1].slice(0); // this should be an error //// [genericArrayMethods1.js] -var x = [0, 1].slice(0); +var x = [0, 1].slice(0);// this should be an error diff --git a/tests/baselines/reference/genericCallSpecializedToTypeArg.js b/tests/baselines/reference/genericCallSpecializedToTypeArg.js index c42e5e820fd..6a14f74d0d2 100644 --- a/tests/baselines/reference/genericCallSpecializedToTypeArg.js +++ b/tests/baselines/reference/genericCallSpecializedToTypeArg.js @@ -14,7 +14,7 @@ function dupe(x) { return x; } function dupeAndGetDist(x) { - var y = dupe(x); + var y = dupe(x);//<-- dupe has incorrect type here y.getDist(); return y; } diff --git a/tests/baselines/reference/genericCallTypeArgumentInference.js b/tests/baselines/reference/genericCallTypeArgumentInference.js index bfbfa291f0e..b80db4b36bd 100644 --- a/tests/baselines/reference/genericCallTypeArgumentInference.js +++ b/tests/baselines/reference/genericCallTypeArgumentInference.js @@ -96,7 +96,7 @@ var r11 = i.foo8(); // {} function foo(t) { return t; } -var r = foo(''); +var r = foo('');// string function foo2(t, u) { return u; } @@ -104,8 +104,8 @@ function foo2b(u) { var x; return x; } -var r2 = foo2('', 1); -var r3 = foo2b(1); +var r2 = foo2('', 1);// number +var r3 = foo2b(1);// {} var C = (function () { function C(t, u) { this.t = t; @@ -141,20 +141,20 @@ var C = (function () { return C; })(); var c = new C('', 1); -var r4 = c.foo('', 1); -var r5 = c.foo2('', 1); -var r6 = c.foo3(true, 1); -var r7 = c.foo4('', true); -var r8 = c.foo5(true, 1); -var r9 = c.foo6(); -var r10 = c.foo7(''); -var r11 = c.foo8(); +var r4 = c.foo('', 1);// string +var r5 = c.foo2('', 1);// number +var r6 = c.foo3(true, 1);// boolean +var r7 = c.foo4('', true);// string +var r8 = c.foo5(true, 1);// boolean +var r9 = c.foo6();// {} +var r10 = c.foo7('');// {} +var r11 = c.foo8();// {} var i; -var r4 = i.foo('', 1); -var r5 = i.foo2('', 1); -var r6 = i.foo3(true, 1); -var r7 = i.foo4('', true); -var r8 = i.foo5(true, 1); -var r9 = i.foo6(); -var r10 = i.foo7(''); -var r11 = i.foo8(); +var r4 = i.foo('', 1);// string +var r5 = i.foo2('', 1);// number +var r6 = i.foo3(true, 1);// boolean +var r7 = i.foo4('', true);// string +var r8 = i.foo5(true, 1);// boolean +var r9 = i.foo6();// {} +var r10 = i.foo7('');// {} +var r11 = i.foo8();// {} diff --git a/tests/baselines/reference/genericCallWithArrayLiteralArgs.js b/tests/baselines/reference/genericCallWithArrayLiteralArgs.js index 9f3619a66ba..828228103ee 100644 --- a/tests/baselines/reference/genericCallWithArrayLiteralArgs.js +++ b/tests/baselines/reference/genericCallWithArrayLiteralArgs.js @@ -17,11 +17,11 @@ var r6 = foo([1, '']); // Object[] function foo(t) { return t; } -var r = foo([1, 2]); -var r = foo([1, 2]); -var ra = foo([1, 2]); -var r2 = foo([]); -var r3 = foo([]); -var r4 = foo([1, '']); -var r5 = foo([1, '']); -var r6 = foo([1, '']); +var r = foo([1, 2]);// number[] +var r = foo([1, 2]);// number[] +var ra = foo([1, 2]);// any[] +var r2 = foo([]);// any[] +var r3 = foo([]);// number[] +var r4 = foo([1, '']);// {}[] +var r5 = foo([1, '']);// any[] +var r6 = foo([1, '']);// Object[] diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js index 2b41b52ae1a..c4079a374a3 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference.js @@ -140,8 +140,8 @@ var d2; function foo(t) { return t; } -var r = foo(b); -var r2 = foo(d1); +var r = foo(b);// Base +var r2 = foo(d1);// Derived function foo2(t, u) { return u; } @@ -153,8 +153,8 @@ function foo2c() { var x; return x; } -var r3 = foo2b(d1); -var r3b = foo2c(); +var r3 = foo2b(d1);// Base +var r3b = foo2c();// Base var C = (function () { function C(t, u) { this.t = t; @@ -190,22 +190,22 @@ var C = (function () { return C; })(); var c = new C(b, d1); -var r4 = c.foo(d1, d2); -var r5 = c.foo2(b, d2); -var r6 = c.foo3(d1, d1); -var r7 = c.foo4(d1, d2); -var r8 = c.foo5(d1, d2); -var r8b = c.foo5(d2, d2); -var r9 = c.foo6(); -var r10 = c.foo7(d1); -var r11 = c.foo8(); +var r4 = c.foo(d1, d2);// Base +var r5 = c.foo2(b, d2);// Derived +var r6 = c.foo3(d1, d1);// Derived +var r7 = c.foo4(d1, d2);// Base +var r8 = c.foo5(d1, d2);// Derived +var r8b = c.foo5(d2, d2);// Derived2 +var r9 = c.foo6();// Derived +var r10 = c.foo7(d1);// Base +var r11 = c.foo8();// Base var i; -var r4 = i.foo(d1, d2); -var r5 = i.foo2(b, d2); -var r6 = i.foo3(d1, d1); -var r7 = i.foo4(d1, d2); -var r8 = i.foo5(d1, d2); -var r8b = i.foo5(d2, d2); -var r9 = i.foo6(); -var r10 = i.foo7(d1); -var r11 = i.foo8(); +var r4 = i.foo(d1, d2);// Base +var r5 = i.foo2(b, d2);// Derived +var r6 = i.foo3(d1, d1);// Derived +var r7 = i.foo4(d1, d2);// Base +var r8 = i.foo5(d1, d2);// Derived +var r8b = i.foo5(d2, d2);// Derived2 +var r9 = i.foo6();// Derived +var r10 = i.foo7(d1);// Base +var r11 = i.foo8();// Base diff --git a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.js b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.js index d4d71a36f1b..2b0e07b0a0e 100644 --- a/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.js +++ b/tests/baselines/reference/genericCallWithConstraintsTypeArgumentInference2.js @@ -18,8 +18,8 @@ function foo(t) { var u; return u; } -var r = foo(1); -var r2 = foo(null); -var r3 = foo(new Object()); -var r4 = foo(1); -var r5 = foo(new Date()); +var r = foo(1);// ok +var r2 = foo(null);// {} +var r3 = foo(new Object());// {} +var r4 = foo(1);// error +var r5 = foo(new Date());// no error diff --git a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.js b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.js index 3115f4f8201..bad01f79470 100644 --- a/tests/baselines/reference/genericCallWithConstructorTypedArguments5.js +++ b/tests/baselines/reference/genericCallWithConstructorTypedArguments5.js @@ -31,18 +31,18 @@ function foo(arg) { return new arg.cb(null); } var arg; -var r = foo(arg); +var r = foo(arg);// {} // more args not allowed var arg2; -var r2 = foo(arg2); +var r2 = foo(arg2);// error var arg3; -var r3 = foo(arg3); +var r3 = foo(arg3);// error function foo2(arg) { return new arg.cb(null, null); } // fewer args ok -var r4 = foo(arg); +var r4 = foo(arg);// {} var arg4; -var r6 = foo(arg4); +var r6 = foo(arg4);// string var arg5; -var r7 = foo(arg5); +var r7 = foo(arg5);// string diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments.js b/tests/baselines/reference/genericCallWithFunctionTypedArguments.js index 3fc134d67f4..a5ab44b43ca 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments.js +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments.js @@ -42,31 +42,31 @@ function other(t: T, u: U) { function foo(x) { return x(null); } -var r = foo(function (x) { return ''; }); -var r2 = foo(function (x) { return ''; }); -var r3 = foo(function (x) { return ''; }); +var r = foo(function (x) { return ''; });// {} +var r2 = foo(function (x) { return ''; });// string +var r3 = foo(function (x) { return ''; });// {} function foo2(x, cb) { return cb(x); } var r4 = foo2(1, function (a) { return ''; -}); -var r5 = foo2(1, function (a) { return ''; }); +});// string, contextual signature instantiation is applied to generic functions +var r5 = foo2(1, function (a) { return ''; });// string var r6 = foo2('', function (a) { return 1; }); function foo3(x, cb, y) { return cb(x); } -var r7 = foo3(1, function (a) { return ''; }, ''); +var r7 = foo3(1, function (a) { return ''; }, '');// string var r8 = foo3(1, function (a) { return ''; -}, 1); -var r9 = foo3(1, function (a) { return ''; }, ''); +}, 1);// {} +var r9 = foo3(1, function (a) { return ''; }, '');// string function other(t, u) { - var r10 = foo2(1, function (x) { return ''; }); - var r10 = foo2(1, function (x) { return ''; }); - var r11 = foo3(1, function (x) { return ''; }, ''); - var r11b = foo3(1, function (x) { return ''; }, 1); + var r10 = foo2(1, function (x) { return ''; });// string, non-generic signature allows inferences to be made + var r10 = foo2(1, function (x) { return ''; });// string + var r11 = foo3(1, function (x) { return ''; }, '');// string + var r11b = foo3(1, function (x) { return ''; }, 1);// {} var r12 = foo3(1, function (a) { return ''; - }, 1); + }, 1);// {} } diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.js b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.js index 91445966e30..3c886dd448b 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments2.js +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments2.js @@ -50,21 +50,21 @@ function foo(x) { var i; var i2; var a; -var r = foo(i); -var r2 = foo(i); -var r3 = foo(i2); -var r3b = foo(a); +var r = foo(i);// any +var r2 = foo(i);// string +var r3 = foo(i2);// string +var r3b = foo(a);// any function foo2(x, cb) { return new cb(x); } -var r4 = foo2(1, i2); -var r4b = foo2(1, a); -var r5 = foo2(1, i); -var r6 = foo2('', i2); +var r4 = foo2(1, i2);// string, instantiated generic +var r4b = foo2(1, a);// any +var r5 = foo2(1, i);// any +var r6 = foo2('', i2);// string function foo3(x, cb, y) { return new cb(x); } -var r7 = foo3(null, i, ''); -var r7b = foo3(null, a, ''); -var r8 = foo3(1, i2, 1); -var r9 = foo3('', i2, ''); +var r7 = foo3(null, i, '');// any +var r7b = foo3(null, a, '');// any +var r8 = foo3(1, i2, 1);// {} +var r9 = foo3('', i2, '');// string diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments3.js b/tests/baselines/reference/genericCallWithFunctionTypedArguments3.js index cd61b1d69f5..a5221507452 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments3.js +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments3.js @@ -27,6 +27,6 @@ function foo4(cb) { var u; return u; } -var r = foo4(a); +var r = foo4(a);// T is {} (candidates boolean and string), U is any (candidates any and boolean) var b; -var r2 = foo4(b); +var r2 = foo4(b);// T is {} (candidates boolean and {}), U is any (candidates any and {}) diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments4.js b/tests/baselines/reference/genericCallWithFunctionTypedArguments4.js index 58208df410c..a1ac8a612c4 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments4.js +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments4.js @@ -39,6 +39,6 @@ function foo4(cb) { var u; return u; } -var r = foo4(a); +var r = foo4(a);// T is {} (candidates boolean and string), U is {} (candidates C and D) var b; -var r2 = foo4(b); +var r2 = foo4(b);// T is {} (candidates boolean and {}), U is any (candidates any and {}) diff --git a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.js b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.js index 543c3ceedb2..94b63f2d790 100644 --- a/tests/baselines/reference/genericCallWithFunctionTypedArguments5.js +++ b/tests/baselines/reference/genericCallWithFunctionTypedArguments5.js @@ -28,15 +28,15 @@ function foo(arg) { return arg.cb(null); } var arg = { cb: function (x) { return ''; } }; -var r = foo(arg); +var r = foo(arg);// {} // more args not allowed -var r2 = foo({ cb: function (x, y) { return ''; } }); -var r3 = foo({ cb: function (x, y) { return ''; } }); +var r2 = foo({ cb: function (x, y) { return ''; } });// error +var r3 = foo({ cb: function (x, y) { return ''; } });// error function foo2(arg) { return arg.cb(null, null); } // fewer args ok -var r4 = foo(arg); -var r5 = foo({ cb: function (x) { return ''; } }); -var r6 = foo({ cb: function (x) { return ''; } }); -var r7 = foo({ cb: function () { return ''; } }); +var r4 = foo(arg);// {} +var r5 = foo({ cb: function (x) { return ''; } });// {} +var r6 = foo({ cb: function (x) { return ''; } });// string +var r7 = foo({ cb: function () { return ''; } });// string diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments.js b/tests/baselines/reference/genericCallWithGenericSignatureArguments.js index 2a2c7eda719..5492e37aa4a 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments.js +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments.js @@ -50,21 +50,21 @@ function foo(a, b) { return r; } //var r1 = foo((x: number) => 1, (x: string) => ''); // error -var r1b = foo(function (x) { return 1; }, function (x) { return ''; }); -var r2 = foo(function (x) { return null; }, function (x) { return ''; }); -var r3 = foo(function (x) { return 1; }, function (x) { return null; }); -var r3ii = foo(function (x) { return 1; }, function (x) { return 1; }); +var r1b = foo(function (x) { return 1; }, function (x) { return ''; });// {} => {} +var r2 = foo(function (x) { return null; }, function (x) { return ''; });// Object => Object +var r3 = foo(function (x) { return 1; }, function (x) { return null; });// number => number +var r3ii = foo(function (x) { return 1; }, function (x) { return 1; });// number => number var a; var b; -var r4 = foo(function (x) { return a; }, function (x) { return b; }); -var r5 = foo(function (x) { return b; }, function (x) { return a; }); +var r4 = foo(function (x) { return a; }, function (x) { return b; });// typeof a => typeof a +var r5 = foo(function (x) { return b; }, function (x) { return a; });// typeof b => typeof b function other(x) { - var r6 = foo(function (a) { return a; }, function (b) { return b; }); - var r6b = foo(function (a) { return a; }, function (b) { return b; }); + var r6 = foo(function (a) { return a; }, function (b) { return b; });// T => T + var r6b = foo(function (a) { return a; }, function (b) { return b; });// {} => {} } function other2(x) { - var r7 = foo(function (a) { return a; }, function (b) { return b; }); - var r7b = foo(function (a) { return a; }, function (b) { return b; }); + var r7 = foo(function (a) { return a; }, function (b) { return b; });// T => T + var r7b = foo(function (a) { return a; }, function (b) { return b; });// {} => {} var r8 = r7(null); } function foo2(a, b) { @@ -72,5 +72,5 @@ function foo2(a, b) { return r; } function other3(x) { - var r8 = foo2(function (a) { return a; }, function (b) { return b; }); + var r8 = foo2(function (a) { return a; }, function (b) { return b; });// Date => Date } diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.js b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.js index fd1ac223b6b..c62351e3ead 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments2.js +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments2.js @@ -45,18 +45,18 @@ function foo(a, b) { } var r1 = foo(function (x) { return 1; }, function (x) { return ''; }); function other2(x) { - var r7 = foo(function (a) { return a; }, function (b) { return b; }); + var r7 = foo(function (a) { return a; }, function (b) { return b; });// T => T // BUG 835518 - var r9 = r7(new Date()); - var r10 = r7(1); + var r9 = r7(new Date());// should be ok + var r10 = r7(1);// error } function foo2(a, b) { var r; return r; } function other3(x) { - var r7 = foo2(function (a) { return a; }, function (b) { return b; }); - var r7b = foo2(function (a) { return a; }, function (b) { return b; }); + var r7 = foo2(function (a) { return a; }, function (b) { return b; });// error + var r7b = foo2(function (a) { return a; }, function (b) { return b; });// valid, T is inferred to be Date } var E; (function (E) { @@ -70,4 +70,4 @@ function foo3(x, a, b) { var r; return r; } -var r7 = foo3(0 /* A */, function (x) { return 0 /* A */; }, function (x) { return 0 /* A */; }); +var r7 = foo3(0 /* A */, function (x) { return 0 /* A */; }, function (x) { return 0 /* A */; });// error diff --git a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.js b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.js index 092a5093702..f7bb33be9fd 100644 --- a/tests/baselines/reference/genericCallWithGenericSignatureArguments3.js +++ b/tests/baselines/reference/genericCallWithGenericSignatureArguments3.js @@ -40,12 +40,12 @@ function foo(x, a, b) { var r; return r; } -var r1 = foo('', function (x) { return ''; }, function (x) { return null; }); -var r1ii = foo('', function (x) { return ''; }, function (x) { return null; }); -var r2 = foo('', function (x) { return ''; }, function (x) { return ''; }); -var r3 = foo(null, function (x) { return ''; }, function (x) { return ''; }); -var r4 = foo(null, function (x) { return ''; }, function (x) { return ''; }); -var r5 = foo(new Object(), function (x) { return ''; }, function (x) { return ''; }); +var r1 = foo('', function (x) { return ''; }, function (x) { return null; });// any => any +var r1ii = foo('', function (x) { return ''; }, function (x) { return null; });// string => string +var r2 = foo('', function (x) { return ''; }, function (x) { return ''; });// string => string +var r3 = foo(null, function (x) { return ''; }, function (x) { return ''; });// Object => Object +var r4 = foo(null, function (x) { return ''; }, function (x) { return ''; });// any => any +var r5 = foo(new Object(), function (x) { return ''; }, function (x) { return ''; });// Object => Object var E; (function (E) { E[E["A"] = 0] = "A"; @@ -54,14 +54,14 @@ var F; (function (F) { F[F["A"] = 0] = "A"; })(F || (F = {})); -var r6 = foo(0 /* A */, function (x) { return 0 /* A */; }, function (x) { return 0 /* A */; }); +var r6 = foo(0 /* A */, function (x) { return 0 /* A */; }, function (x) { return 0 /* A */; });// number => number function foo2(x, a, b) { var r; return r; } -var r8 = foo2('', function (x) { return ''; }, function (x) { return null; }); -var r9 = foo2(null, function (x) { return ''; }, function (x) { return ''; }); -var r10 = foo2(null, function (x) { return ''; }, function (x) { return ''; }); +var r8 = foo2('', function (x) { return ''; }, function (x) { return null; });// string => string +var r9 = foo2(null, function (x) { return ''; }, function (x) { return ''; });// any => any +var r10 = foo2(null, function (x) { return ''; }, function (x) { return ''; });// Object => Object var x; -var r11 = foo2(x, function (a1) { return function (n) { return 1; }; }, function (a2) { return 2; }); -var r12 = foo2(x, function (a1) { return function (n) { return 1; }; }, function (a2) { return 2; }); +var r11 = foo2(x, function (a1) { return function (n) { return 1; }; }, function (a2) { return 2; });// {} => {} +var r12 = foo2(x, function (a1) { return function (n) { return 1; }; }, function (a2) { return 2; });// (string => boolean) => {} diff --git a/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.js b/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.js index 3d97dfede32..78c5b93264f 100644 --- a/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.js +++ b/tests/baselines/reference/genericCallWithNonSymmetricSubtypes.js @@ -40,17 +40,17 @@ function foo(x, y) { } var a; var b; -var r = foo(a, b); -var r2 = foo(b, a); +var r = foo(a, b);// { x: number; y?: number; }; +var r2 = foo(b, a);// { x: number; z?: number; }; var x; var y; -var r3 = foo(a, x); -var r4 = foo(x, a); -var r5 = foo(a, y); -var r5 = foo(y, a); -var r6 = foo(x, y); -var r6 = foo(y, x); +var r3 = foo(a, x);// { x: number; y?: number; }; +var r4 = foo(x, a);// { x: number; }; +var r5 = foo(a, y);// { x?: number; }; +var r5 = foo(y, a);// { x?: number; }; +var r6 = foo(x, y);// { x?: number; }; +var r6 = foo(y, x);// { x?: number; }; var s1; var s2; -var r7 = foo(s1, s2); -var r8 = foo(s2, s1); +var r7 = foo(s1, s2);// (x: Object) => string; +var r8 = foo(s2, s1);// (x: string) => string; diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArgs.js b/tests/baselines/reference/genericCallWithObjectLiteralArgs.js index 7ff09340d71..f9bad34d2ec 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArgs.js +++ b/tests/baselines/reference/genericCallWithObjectLiteralArgs.js @@ -13,8 +13,8 @@ var r4 = foo({ bar: 1, baz: '' }); // T = Object function foo(x) { return x; } -var r = foo({ bar: 1, baz: '' }); -var r2 = foo({ bar: 1, baz: 1 }); +var r = foo({ bar: 1, baz: '' });// T = {} +var r2 = foo({ bar: 1, baz: 1 });// T = number // BUG 835724 -var r3 = foo({ bar: foo, baz: foo }); -var r4 = foo({ bar: 1, baz: '' }); +var r3 = foo({ bar: foo, baz: foo });// T = any +var r4 = foo({ bar: 1, baz: '' });// T = Object diff --git a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js index b731e5fe942..42c34a0b8b9 100644 --- a/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js +++ b/tests/baselines/reference/genericCallWithObjectLiteralArguments1.js @@ -11,7 +11,7 @@ var x5 = foo({ x: "", y: 4 }, ""); function foo(n, m) { return m; } -var x = foo({ x: 3, y: "" }, 4); +var x = foo({ x: 3, y: "" }, 4);// no error, x is Object, the best common type // these are all errors var x2 = foo({ x: 3, y: "" }, 4); var x3 = foo({ x: 3, y: "" }, 4); diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs.js b/tests/baselines/reference/genericCallWithObjectTypeArgs.js index 69658c83991..19495dc0c38 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs.js @@ -43,5 +43,5 @@ function foo(t, t2) { } var c1 = new X(); var d1 = new X(); -var r = foo(c1, d1); -var r2 = foo(c1, c1); +var r = foo(c1, d1);// error +var r2 = foo(c1, c1);// ok diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js index 160b4885cfd..7b3d2f43ae0 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgs2.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgs2.js @@ -62,11 +62,11 @@ var Derived2 = (function (_super) { function f(a) { return [a.x, a.y]; } -var r = f({ x: new Derived(), y: new Derived2() }); -var r2 = f({ x: new Base(), y: new Derived2() }); +var r = f({ x: new Derived(), y: new Derived2() });// {}[] +var r2 = f({ x: new Base(), y: new Derived2() });// {}[] function f2(a) { return function (x) { return a.y; }; } -var r3 = f2({ x: new Derived(), y: new Derived2() }); +var r3 = f2({ x: new Derived(), y: new Derived2() });// Derived => Derived2 var i; -var r4 = f2(i); +var r4 = f2(i);// Base => Derived diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js index 6cc9902c932..d1aeca072b9 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints2.js @@ -76,5 +76,5 @@ function f3(x, y) { } var r4 = f3(new Base(), function (x) { return x; }); var r5 = f3(new Derived(), function (x) { return x; }); -var r6 = f3(null, null); -var r7 = f3(null, function (x) { return x; }); +var r6 = f3(null, null);// any +var r7 = f3(null, function (x) { return x; });// any diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js index 7c0e656b7e7..f45418f2523 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints3.js @@ -68,13 +68,13 @@ function f(a) { var r; return r; } -var r1 = f({ x: new Derived(), y: new Derived2() }); +var r1 = f({ x: new Derived(), y: new Derived2() });// ok, both extend Base function f2(a) { var r; return r; } -var r2 = f2({ x: new Derived(), y: new Derived2() }); -var r3 = f2({ x: new Derived(), y: new Derived2() }); +var r2 = f2({ x: new Derived(), y: new Derived2() });// ok +var r3 = f2({ x: new Derived(), y: new Derived2() });// ok function f3(y, x) { return y(null); } diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.js index 7e25ac69baf..5e5adc6fde2 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints4.js @@ -51,7 +51,7 @@ function foo(t, t2) { var c; var d; var r = foo(c, d); -var r2 = foo(d, c); +var r2 = foo(d, c);// error because C does not extend D var r3 = foo(c, { x: '', foo: c }); var r4 = foo(null, null); var r5 = foo({}, null); @@ -64,5 +64,5 @@ var r9 = foo(function () { }, function () { return 1; }); function other() { var r4 = foo(c, d); - var r5 = foo(c, d); + var r5 = foo(c, d);// error } diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.js index 0ac160418d9..4744e3410c2 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndConstraints5.js @@ -41,9 +41,9 @@ function foo(t, t2) { } var c; var d; -var r2 = foo(d, c); +var r2 = foo(d, c);// the constraints are self-referencing, no downstream error var r9 = foo(function () { return 1; }, function () { -}); +});// the constraints are self-referencing, no downstream error function other() { - var r5 = foo(c, d); + var r5 = foo(c, d);// error } diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.js index d8fb8dd7125..4d419169691 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndIndexersErrors.js @@ -31,12 +31,12 @@ function foo(x) { } function other(arg) { var b; - var r2 = foo(b); + var r2 = foo(b);// T } function other3(arg) { var b; var r2 = foo(b); var d = r2[1]; var e = r2['1']; - var u = r2[1]; + var u = r2[1];// ok } diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.js index 2e16b232b29..e374c83a622 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndInitializers.js @@ -14,23 +14,23 @@ function foo7(x: V, y: U = x) { } // should be ok function foo(x) { if (x === void 0) { x = null; } return x; -} +}// ok function foo2(x) { if (x === void 0) { x = undefined; } return x; -} +}// ok function foo3(x) { if (x === void 0) { x = 1; } -} +}// error function foo4(x, y) { if (y === void 0) { y = x; } -} +}// error function foo5(x, y) { if (y === void 0) { y = x; } -} +}// ok function foo6(x, y, z) { if (z === void 0) { z = y; } -} +}// error function foo7(x, y) { if (y === void 0) { y = x; } -} +}// should be ok diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.js index c016b8550d1..be111a67d22 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndNumericIndexer.js @@ -43,7 +43,7 @@ var a; var r = foo(a); function other(arg) { var b; - var r2 = foo(b); + var r2 = foo(b);// T } function other2(arg) { var b; diff --git a/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.js b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.js index 21bf9e42c55..5061bd9dee9 100644 --- a/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.js +++ b/tests/baselines/reference/genericCallWithObjectTypeArgsAndStringIndexer.js @@ -44,15 +44,15 @@ var a; var r = foo(a); function other(arg) { var b; - var r2 = foo(b); + var r2 = foo(b);// T } function other2(arg) { var b; var r2 = foo(b); - var d = r2['hm']; + var d = r2['hm'];// ok } function other3(arg) { var b; var r2 = foo(b); - var d = r2['hm']; + var d = r2['hm'];// ok } diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.js b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.js index 2d389739979..9ea0bec6814 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.js +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments.js @@ -67,20 +67,20 @@ var GenericParameter; return cb; } var a; - var r5 = foo5(a); + var r5 = foo5(a);// new{} => string; new(x:number) => {} var b; - var r7 = foo5(b); + var r7 = foo5(b);// new any => string; new(x:number) => any function foo6(cb) { return cb; } - var r8 = foo6(a); - var r9 = foo6(b); + var r8 = foo6(a);// new{} => string; new(x:{}, y?:{}) => string + var r9 = foo6(b);// new any => string; new(x:any, y?:any) => string function foo7(x, cb) { return cb; } - var r13 = foo7(1, b); + var r13 = foo7(1, b);// new any => string; new(x:any, y?:any) => string var c; var c2; - var r14 = foo7(1, c); - var r15 = foo7(1, c2); + var r14 = foo7(1, c);// new any => string; new(x:any, y?:any) => string + var r15 = foo7(1, c2);// new any => string; new(x:any, y?:any) => string })(GenericParameter || (GenericParameter = {})); diff --git a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.js b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.js index 3e5d91423ae..725ee99fbb8 100644 --- a/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.js +++ b/tests/baselines/reference/genericCallWithOverloadedConstructorTypedArguments2.js @@ -50,7 +50,7 @@ var NonGenericParameter; return cb; } var b; - var r3 = foo4(b); + var r3 = foo4(b);// ok })(NonGenericParameter || (NonGenericParameter = {})); var GenericParameter; (function (GenericParameter) { @@ -58,16 +58,16 @@ var GenericParameter; return cb; } var a; - var r6 = foo5(a); + var r6 = foo5(a);// ok function foo6(cb) { return cb; } var b; - var r10 = foo6(b); + var r10 = foo6(b);// error function foo7(x, cb) { return cb; } - var r13 = foo7(1, a); + var r13 = foo7(1, a);// ok var c; - var r14 = foo7(1, c); + var r14 = foo7(1, c);// ok })(GenericParameter || (GenericParameter = {})); diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.js b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.js index f28983c0a22..ad86464cc75 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.js +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments.js @@ -62,20 +62,20 @@ var GenericParameter; function foo5(cb) { return cb; } - var r5 = foo5(function (x) { return x; }); + var r5 = foo5(function (x) { return x; });// any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any var a; - var r7 = foo5(a); + var r7 = foo5(a);// any => string (+1 overload) function foo6(cb) { return cb; } - var r8 = foo6(function (x) { return x; }); - var r9 = foo6(function (x) { return ''; }); - var r11 = foo6(function (x, y) { return ''; }); + var r8 = foo6(function (x) { return x; });// any => string (+1 overload) [inferences are made for T, but lambda not contextually typed]. T is any + var r9 = foo6(function (x) { return ''; });// any => string (+1 overload) + var r11 = foo6(function (x, y) { return ''; });// any => string (+1 overload) function foo7(x, cb) { return cb; } - var r12 = foo7(1, function (x) { return x; }); - var r13 = foo7(1, function (x) { return ''; }); + var r12 = foo7(1, function (x) { return x; });// any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] + var r13 = foo7(1, function (x) { return ''; });// any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] var a; - var r14 = foo7(1, a); + var r14 = foo7(1, a);// any => string (+1 overload) [inferences are made for T, but lambda not contextually typed] })(GenericParameter || (GenericParameter = {})); diff --git a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.js b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.js index 901db22bd68..b0434974ede 100644 --- a/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.js +++ b/tests/baselines/reference/genericCallWithOverloadedFunctionTypedArguments2.js @@ -49,22 +49,22 @@ var NonGenericParameter; var r3 = foo4(function (x) { var r; return r; - }); + });// ok })(NonGenericParameter || (NonGenericParameter = {})); var GenericParameter; (function (GenericParameter) { function foo5(cb) { return cb; } - var r6 = foo5(function (x) { return x; }); + var r6 = foo5(function (x) { return x; });// ok function foo6(cb) { return cb; } - var r10 = foo6(function (x, y) { return ''; }); + var r10 = foo6(function (x, y) { return ''; });// error function foo7(x, cb) { return cb; } - var r13 = foo7(1, function (x) { return x; }); + var r13 = foo7(1, function (x) { return x; });// ok var a; - var r14 = foo7(1, a); + var r14 = foo7(1, a);// ok })(GenericParameter || (GenericParameter = {})); diff --git a/tests/baselines/reference/genericChainedCalls.js b/tests/baselines/reference/genericChainedCalls.js index 536d156196e..6ffd554a45c 100644 --- a/tests/baselines/reference/genericChainedCalls.js +++ b/tests/baselines/reference/genericChainedCalls.js @@ -17,5 +17,5 @@ var s3 = s2.func(num => num.toString()) //// [genericChainedCalls.js] var r1 = v1.func(function (num) { return num.toString(); }).func(function (str) { return str.length; }).func(function (num) { return num.toString(); }); var s1 = v1.func(function (num) { return num.toString(); }); -var s2 = s1.func(function (str) { return str.length; }); +var s2 = s1.func(function (str) { return str.length; })// should also error ;// should also error var s3 = s2.func(function (num) { return num.toString(); }); diff --git a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js index 0fc7d665fe4..c669c286307 100644 --- a/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js +++ b/tests/baselines/reference/genericClassWithFunctionTypedMemberArguments.js @@ -78,9 +78,9 @@ var ImmediatelyFix; return C; })(); var c = new C(); - var r = c.foo(function (x) { return ''; }); - var r2 = c.foo(function (x) { return ''; }); - var r3 = c.foo(function (x) { return ''; }); + var r = c.foo(function (x) { return ''; });// {} + var r2 = c.foo(function (x) { return ''; });// string + var r3 = c.foo(function (x) { return ''; });// {} var C2 = (function () { function C2() { } @@ -90,8 +90,8 @@ var ImmediatelyFix; return C2; })(); var c2 = new C2(); - var ra = c2.foo(function (x) { return 1; }); - var r3a = c2.foo(function (x) { return 1; }); + var ra = c2.foo(function (x) { return 1; });// number + var r3a = c2.foo(function (x) { return 1; });// number })(ImmediatelyFix || (ImmediatelyFix = {})); var WithCandidates; (function (WithCandidates) { @@ -106,9 +106,9 @@ var WithCandidates; var c; var r4 = c.foo2(1, function (a) { return ''; - }); - var r5 = c.foo2(1, function (a) { return ''; }); - var r6 = c.foo2('', function (a) { return 1; }); + });// string, contextual signature instantiation is applied to generic functions + var r5 = c.foo2(1, function (a) { return ''; });// string + var r6 = c.foo2('', function (a) { return 1; });// number var C2 = (function () { function C2() { } @@ -118,10 +118,10 @@ var WithCandidates; return C2; })(); var c2; - var r7 = c2.foo3(1, function (a) { return ''; }, ''); + var r7 = c2.foo3(1, function (a) { return ''; }, '');// string var r8 = c2.foo3(1, function (a) { return ''; - }, ''); + }, '');// string var C3 = (function () { function C3() { } @@ -132,12 +132,12 @@ var WithCandidates; })(); var c3; function other(t, u) { - var r10 = c.foo2(1, function (x) { return ''; }); - var r10 = c.foo2(1, function (x) { return ''; }); - var r11 = c3.foo3(1, function (x) { return ''; }, ''); - var r11b = c3.foo3(1, function (x) { return ''; }, 1); + var r10 = c.foo2(1, function (x) { return ''; });// string, non-generic signature allows inferences to be made + var r10 = c.foo2(1, function (x) { return ''; });// string + var r11 = c3.foo3(1, function (x) { return ''; }, '');// string + var r11b = c3.foo3(1, function (x) { return ''; }, 1);// {} var r12 = c3.foo3(1, function (a) { return ''; - }, 1); + }, 1);// {} } })(WithCandidates || (WithCandidates = {})); diff --git a/tests/baselines/reference/genericClasses0.js b/tests/baselines/reference/genericClasses0.js index 4b69110269a..7bc92d7f78f 100644 --- a/tests/baselines/reference/genericClasses0.js +++ b/tests/baselines/reference/genericClasses0.js @@ -14,7 +14,7 @@ var C = (function () { return C; })(); var v1; -var y = v1.x; +var y = v1.x;// should be 'string' //// [genericClasses0.d.ts] diff --git a/tests/baselines/reference/genericClasses1.js b/tests/baselines/reference/genericClasses1.js index b3747a1023a..8830fac3159 100644 --- a/tests/baselines/reference/genericClasses1.js +++ b/tests/baselines/reference/genericClasses1.js @@ -14,7 +14,7 @@ var C = (function () { return C; })(); var v1 = new C(); -var y = v1.x; +var y = v1.x;// should be 'string' //// [genericClasses1.d.ts] diff --git a/tests/baselines/reference/genericClasses2.js b/tests/baselines/reference/genericClasses2.js index 86393702b0c..44f7e1711da 100644 --- a/tests/baselines/reference/genericClasses2.js +++ b/tests/baselines/reference/genericClasses2.js @@ -22,9 +22,9 @@ var C = (function () { return C; })(); var v1; -var y = v1.x; -var w = v1.y.a; -var z = v1.z.a; +var y = v1.x;// should be 'string' +var w = v1.y.a;// should be 'string' +var z = v1.z.a;// should be 'number' //// [genericClasses2.d.ts] diff --git a/tests/baselines/reference/genericClasses3.js b/tests/baselines/reference/genericClasses3.js index 48634b449ec..d4f75b1d98f 100644 --- a/tests/baselines/reference/genericClasses3.js +++ b/tests/baselines/reference/genericClasses3.js @@ -37,8 +37,8 @@ var C = (function (_super) { return C; })(B); var v2; -var y = v2.x; -var u = v2.a; +var y = v2.x;// should be 'string' +var u = v2.a;// should be 'string' var z = v2.b; diff --git a/tests/baselines/reference/genericCloneReturnTypes2.js b/tests/baselines/reference/genericCloneReturnTypes2.js index 5784e3bbec3..57cdbd3d1da 100644 --- a/tests/baselines/reference/genericCloneReturnTypes2.js +++ b/tests/baselines/reference/genericCloneReturnTypes2.js @@ -27,6 +27,6 @@ var MyList = (function () { return MyList; })(); var a; -var b = a.clone(); -var c = a.clone(); -var d = a.clone(); +var b = a.clone();// ok +var c = a.clone();// bug was there was an error on this line +var d = a.clone();// error diff --git a/tests/baselines/reference/genericFunctions0.js b/tests/baselines/reference/genericFunctions0.js index 353aef05bac..dc4cc671222 100644 --- a/tests/baselines/reference/genericFunctions0.js +++ b/tests/baselines/reference/genericFunctions0.js @@ -7,7 +7,7 @@ var x = foo(5); // 'x' should be number function foo(x) { return x; } -var x = foo(5); +var x = foo(5);// 'x' should be number //// [genericFunctions0.d.ts] diff --git a/tests/baselines/reference/genericFunctions1.js b/tests/baselines/reference/genericFunctions1.js index 48d9cad9af7..942dfc4650f 100644 --- a/tests/baselines/reference/genericFunctions1.js +++ b/tests/baselines/reference/genericFunctions1.js @@ -7,7 +7,7 @@ var x = foo(5); // 'x' should be number function foo(x) { return x; } -var x = foo(5); +var x = foo(5);// 'x' should be number //// [genericFunctions1.d.ts] diff --git a/tests/baselines/reference/genericImplements.js b/tests/baselines/reference/genericImplements.js index 68e8b1111e8..8b04a6f5a81 100644 --- a/tests/baselines/reference/genericImplements.js +++ b/tests/baselines/reference/genericImplements.js @@ -41,7 +41,7 @@ var X = (function () { return undefined; }; return X; -})(); +})();// { f: () => { b; } } // OK var Y = (function () { function Y() { @@ -50,7 +50,7 @@ var Y = (function () { return undefined; }; return Y; -})(); +})();// { f: () => { a; } } // OK var Z = (function () { function Z() { @@ -59,4 +59,4 @@ var Z = (function () { return undefined; }; return Z; -})(); +})();// { f: () => T } diff --git a/tests/baselines/reference/genericInference2.js b/tests/baselines/reference/genericInference2.js index 99be1a38eb7..2d21fcc9d19 100644 --- a/tests/baselines/reference/genericInference2.js +++ b/tests/baselines/reference/genericInference2.js @@ -25,9 +25,9 @@ var o = { name: ko.observable("Bob"), age: ko.observable(37) }; -var x_v = o.name().length; -var age_v = o.age(); -var name_v = o.name("Robert"); -var zz_v = o.name.N; -var yy_v = o.name.g; -var rr_v = o.name.r; +var x_v = o.name().length;// should be 'number' +var age_v = o.age();// should be 'number' +var name_v = o.name("Robert");// should be 'any' +var zz_v = o.name.N;// should be 'number' +var yy_v = o.name.g;// should be 'boolean' +var rr_v = o.name.r;// should be 'string' diff --git a/tests/baselines/reference/genericOfACloduleType1.js b/tests/baselines/reference/genericOfACloduleType1.js index d0ffd8f3657..f8fbebdaac0 100644 --- a/tests/baselines/reference/genericOfACloduleType1.js +++ b/tests/baselines/reference/genericOfACloduleType1.js @@ -43,4 +43,4 @@ var M; var g1 = new G(); g1.bar(null).foo(); })(M || (M = {})); -var g2 = new G(); +var g2 = new G()// was: error Type reference cannot refer to container 'M.C'. ;// was: error Type reference cannot refer to container 'M.C'. diff --git a/tests/baselines/reference/genericReduce.js b/tests/baselines/reference/genericReduce.js index a4955d52fb9..1cae31a0bc6 100644 --- a/tests/baselines/reference/genericReduce.js +++ b/tests/baselines/reference/genericReduce.js @@ -22,6 +22,6 @@ n1.x = "fail"; n1.toExponential(2); n2.x = "fail"; n2.toExponential(2); -var n3 = b.reduce(function (x, y) { return x + y; }, ""); +var n3 = b.reduce(function (x, y) { return x + y; }, "");// Initial value is of type string n3.toExponential(2); n3.charAt(0); diff --git a/tests/baselines/reference/genericRestArgs.js b/tests/baselines/reference/genericRestArgs.js index 5e28ddf2a1f..61b09ac5582 100644 --- a/tests/baselines/reference/genericRestArgs.js +++ b/tests/baselines/reference/genericRestArgs.js @@ -20,13 +20,13 @@ function makeArrayG() { } return items; } -var a1Ga = makeArrayG(1, ""); +var a1Ga = makeArrayG(1, "");// no error var a1Gb = makeArrayG(1, ""); var a1Gc = makeArrayG(1, ""); -var a1Gd = makeArrayG(1, ""); +var a1Gd = makeArrayG(1, "");// error function makeArrayGOpt(item1, item2, item3) { return [item1, item2, item3]; } var a2Ga = makeArrayGOpt(1, ""); var a2Gb = makeArrayG(1, ""); -var a2Gc = makeArrayG(1, ""); +var a2Gc = makeArrayG(1, "");// error diff --git a/tests/baselines/reference/genericReversingTypeParameters.js b/tests/baselines/reference/genericReversingTypeParameters.js index eede7e23d62..b1ef2d8db4f 100644 --- a/tests/baselines/reference/genericReversingTypeParameters.js +++ b/tests/baselines/reference/genericReversingTypeParameters.js @@ -24,5 +24,5 @@ var BiMap = (function () { })(); var b = new BiMap(); var r1 = b.get(''); -var i = b.inverse(); +var i = b.inverse();// used to get the type wrong here. var r2b = i.get(1); diff --git a/tests/baselines/reference/genericReversingTypeParameters2.js b/tests/baselines/reference/genericReversingTypeParameters2.js index 4dd87401775..2753cb7deb9 100644 --- a/tests/baselines/reference/genericReversingTypeParameters2.js +++ b/tests/baselines/reference/genericReversingTypeParameters2.js @@ -22,5 +22,5 @@ var BiMap = (function () { return BiMap; })(); var b = new BiMap(); -var i = b.inverse(); +var i = b.inverse();// used to get the type wrong here. var r2b = i.get(1); diff --git a/tests/baselines/reference/genericTypeAssertions1.js b/tests/baselines/reference/genericTypeAssertions1.js index 091455a7a45..7810ce58e3b 100644 --- a/tests/baselines/reference/genericTypeAssertions1.js +++ b/tests/baselines/reference/genericTypeAssertions1.js @@ -13,5 +13,5 @@ var A = (function () { return A; })(); var foo = new A(); -var r = new A(); -var r2 = foo; +var r = new A();// error +var r2 = foo;// error diff --git a/tests/baselines/reference/genericTypeAssertions2.js b/tests/baselines/reference/genericTypeAssertions2.js index 333417379c6..1394667a808 100644 --- a/tests/baselines/reference/genericTypeAssertions2.js +++ b/tests/baselines/reference/genericTypeAssertions2.js @@ -39,7 +39,7 @@ var B = (function (_super) { })(A); var foo = new A(); var r = new B(); -var r2 = new B(); -var r3 = new B(); +var r2 = new B();// error +var r3 = new B();// error var r4 = new A(); -var r5 = []; +var r5 = [];// error diff --git a/tests/baselines/reference/genericTypeAssertions3.js b/tests/baselines/reference/genericTypeAssertions3.js index d59dd31e868..5f5666486d9 100644 --- a/tests/baselines/reference/genericTypeAssertions3.js +++ b/tests/baselines/reference/genericTypeAssertions3.js @@ -6,7 +6,7 @@ var s = < (x: T) => T > ((x: any) => { return null; }); // no error //// [genericTypeAssertions3.js] var r = (function (x) { return null; -}); +});// bug was 'could not find dotted symbol T' on x's annotation in the type assertion instead of no error var s = (function (x) { return null; -}); +});// no error diff --git a/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.js b/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.js index 9c4dd761ad8..b874e80c429 100644 --- a/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.js +++ b/tests/baselines/reference/genericTypeReferencesRequireTypeArgs.js @@ -20,7 +20,7 @@ var C = (function () { }; return C; })(); -var c1; -var i1; -var c2; -var i2; +var c1;// error +var i1;// error +var c2;// should be an error +var i2;// should be an error diff --git a/tests/baselines/reference/genericTypeWithCallableMembers.js b/tests/baselines/reference/genericTypeWithCallableMembers.js index c885859dcfd..75c4e3eac40 100644 --- a/tests/baselines/reference/genericTypeWithCallableMembers.js +++ b/tests/baselines/reference/genericTypeWithCallableMembers.js @@ -19,8 +19,8 @@ var C = (function () { this.data2 = data2; } C.prototype.create = function () { - var x = new this.data(); - var x2 = new this.data2(); + var x = new this.data();// no error + var x2 = new this.data2();// was error, shouldn't be }; return C; })(); diff --git a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.js b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.js index 6fda8db13f5..a5b785a4d07 100644 --- a/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.js +++ b/tests/baselines/reference/genericTypeWithNonGenericBaseMisMatch.js @@ -18,4 +18,4 @@ var X = (function () { return X; })(); var x = new X(); -var i = x; +var i = x;// Should not be allowed -- type of 'f' is incompatible with 'I' diff --git a/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.js b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.js index b80b1268f35..48ef00d99ac 100644 --- a/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.js +++ b/tests/baselines/reference/genericWithIndexerOfTypeParameterType1.js @@ -19,4 +19,4 @@ var LazyArray = (function () { return LazyArray; })(); var lazyArray = new LazyArray(); -var value = lazyArray.array()["test"]; +var value = lazyArray.array()["test"];// used to be an error diff --git a/tests/baselines/reference/genericWithOpenTypeParameters1.js b/tests/baselines/reference/genericWithOpenTypeParameters1.js index f007f182106..b7b257c283a 100644 --- a/tests/baselines/reference/genericWithOpenTypeParameters1.js +++ b/tests/baselines/reference/genericWithOpenTypeParameters1.js @@ -24,13 +24,13 @@ var x; x.foo(1); var f = function (x) { return x.foo(1); -}; +}// error // error ;// error var f2 = function (x) { return x.foo(1); -}; +}// error // error ;// error var f3 = function (x) { return x.foo(1); -}; +}// error // error ;// error var f4 = function (x) { return x.foo(1); -}; +}// no error // no error ;// no error diff --git a/tests/baselines/reference/generics0.js b/tests/baselines/reference/generics0.js index 844ca59b92b..384bbe47596 100644 --- a/tests/baselines/reference/generics0.js +++ b/tests/baselines/reference/generics0.js @@ -9,7 +9,7 @@ var z = v2.x; // 'y' should be of type 'string' //// [generics0.js] var v2; -var z = v2.x; +var z = v2.x;// 'y' should be of type 'string' //// [generics0.d.ts] diff --git a/tests/baselines/reference/generics1.js b/tests/baselines/reference/generics1.js index 2e8571cba2d..4136d401a12 100644 --- a/tests/baselines/reference/generics1.js +++ b/tests/baselines/reference/generics1.js @@ -16,10 +16,10 @@ var v7: G; // Error, no type arguments //// [generics1.js] -var v1; -var v2; -var v3; -var v4; -var v5; -var v6; -var v7; +var v1;// Ok +var v2;// Ok, equivalent to G +var v3;// Error, A not valid argument for U +var v4;// Ok +var v5;// Error, any does not satisfy constraint B +var v6;// Error, wrong number of arguments +var v7;// Error, no type arguments diff --git a/tests/baselines/reference/generics1NoError.js b/tests/baselines/reference/generics1NoError.js index 07b640bdba5..c0525777b4c 100644 --- a/tests/baselines/reference/generics1NoError.js +++ b/tests/baselines/reference/generics1NoError.js @@ -11,9 +11,9 @@ var v2: G<{ a: string }, C>; // Ok, equivalent to G var v4: G, C>; // Ok //// [generics1NoError.js] -var v1; -var v2; -var v4; +var v1;// Ok +var v2;// Ok, equivalent to G +var v4;// Ok //// [generics1NoError.d.ts] diff --git a/tests/baselines/reference/generics2.js b/tests/baselines/reference/generics2.js index cf8984fe3bd..6ac18835fee 100644 --- a/tests/baselines/reference/generics2.js +++ b/tests/baselines/reference/generics2.js @@ -23,10 +23,10 @@ var v7: G; // Error, no type arguments //// [generics2.js] -var v1; -var v2; -var v3; -var v4; -var v5; -var v6; -var v7; +var v1;// Ok +var v2;// Ok, equivalent to G +var v3;// Error, A not valid argument for U +var v4;// Ok +var v5;// Error, any does not satisfy constraint B +var v6;// Error, wrong number of arguments +var v7;// Error, no type arguments diff --git a/tests/baselines/reference/generics2NoError.js b/tests/baselines/reference/generics2NoError.js index 703eb2152c9..8b6011c498b 100644 --- a/tests/baselines/reference/generics2NoError.js +++ b/tests/baselines/reference/generics2NoError.js @@ -18,9 +18,9 @@ var v2: G<{ a: string }, C>; // Ok, equivalent to G var v4: G, C>; // Ok //// [generics2NoError.js] -var v1; -var v2; -var v4; +var v1;// Ok +var v2;// Ok, equivalent to G +var v4;// Ok //// [generics2NoError.d.ts] diff --git a/tests/baselines/reference/generics5.js b/tests/baselines/reference/generics5.js index 3020a9941e0..3898e72d962 100644 --- a/tests/baselines/reference/generics5.js +++ b/tests/baselines/reference/generics5.js @@ -13,4 +13,4 @@ var v3: G; // Error, A not valid argument for U //// [generics5.js] -var v3; +var v3;// Error, A not valid argument for U diff --git a/tests/baselines/reference/globalThis.js b/tests/baselines/reference/globalThis.js index 1479658fdd5..f9e122b6e5b 100644 --- a/tests/baselines/reference/globalThis.js +++ b/tests/baselines/reference/globalThis.js @@ -2,4 +2,4 @@ var __e = Math.E; // should not generate 'this.Math.E' //// [globalThis.js] -var __e = Math.E; +var __e = Math.E;// should not generate 'this.Math.E' diff --git a/tests/baselines/reference/heterogeneousArrayLiterals.js b/tests/baselines/reference/heterogeneousArrayLiterals.js index 048c88e04bb..603ea63ee56 100644 --- a/tests/baselines/reference/heterogeneousArrayLiterals.js +++ b/tests/baselines/reference/heterogeneousArrayLiterals.js @@ -139,20 +139,20 @@ var __extends = this.__extends || function (d, b) { d.prototype = new __(); }; // type of an array is the best common type of its elements (plus its contextual type if it exists) -var a = [1, '']; -var b = [1, null]; -var c = [1, '', null]; -var d = [{}, 1]; -var e = [{}, Object]; -var f = [[], [1]]; -var g = [[1], ['']]; -var h = [{ foo: 1, bar: '' }, { foo: 2 }]; -var i = [{ foo: 1, bar: '' }, { foo: '' }]; -var j = [function () { return 1; }, function () { return ''; }]; -var k = [function () { return 1; }, function () { return 1; }]; -var l = [function () { return 1; }, function () { return null; }]; -var m = [function () { return 1; }, function () { return ''; }, function () { return null; }]; -var n = [[function () { return 1; }], [function () { return ''; }]]; +var a = [1, ''];// {}[] +var b = [1, null];// number[] +var c = [1, '', null];// {}[] +var d = [{}, 1];// {}[] +var e = [{}, Object];// {}[] +var f = [[], [1]];// number[][] +var g = [[1], ['']];// {}[] +var h = [{ foo: 1, bar: '' }, { foo: 2 }];// {foo: number}[] +var i = [{ foo: 1, bar: '' }, { foo: '' }];// {}[] +var j = [function () { return 1; }, function () { return ''; }];// {}[] +var k = [function () { return 1; }, function () { return 1; }];// { (): number }[] +var l = [function () { return 1; }, function () { return null; }];// { (): any }[] +var m = [function () { return 1; }, function () { return ''; }, function () { return null; }];// { (): any }[] +var n = [[function () { return 1; }], [function () { return ''; }]];// {}[] var Base = (function () { function Base() { } @@ -177,16 +177,16 @@ var derived; var derived2; var Derived; (function (Derived) { - var h = [{ foo: base, basear: derived }, { foo: base }]; - var i = [{ foo: base, basear: derived }, { foo: derived }]; - var j = [function () { return base; }, function () { return derived; }]; - var k = [function () { return base; }, function () { return 1; }]; - var l = [function () { return base; }, function () { return null; }]; - var m = [function () { return base; }, function () { return derived; }, function () { return null; }]; - var n = [[function () { return base; }], [function () { return derived; }]]; - var o = [derived, derived2]; - var p = [derived, derived2, base]; - var q = [[function () { return derived2; }], [function () { return derived; }]]; + var h = [{ foo: base, basear: derived }, { foo: base }];// {foo: Base}[] + var i = [{ foo: base, basear: derived }, { foo: derived }];// {foo: Derived}[] + var j = [function () { return base; }, function () { return derived; }];// { {}: Base } + var k = [function () { return base; }, function () { return 1; }];// {}[]~ + var l = [function () { return base; }, function () { return null; }];// { (): any }[] + var m = [function () { return base; }, function () { return derived; }, function () { return null; }];// { (): any }[] + var n = [[function () { return base; }], [function () { return derived; }]];// { (): Base }[] + var o = [derived, derived2];// {}[] + var p = [derived, derived2, base];// Base[] + var q = [[function () { return derived2; }], [function () { return derived; }]];// {}[] })(Derived || (Derived = {})); var WithContextualType; (function (WithContextualType) { @@ -197,47 +197,47 @@ var WithContextualType; var d = [function () { return derived; }, function () { return derived2; }]; })(WithContextualType || (WithContextualType = {})); function foo(t, u) { - var a = [t, t]; - var b = [t, null]; - var c = [t, u]; - var d = [t, 1]; - var e = [function () { return t; }, function () { return u; }]; - var f = [function () { return t; }, function () { return u; }, function () { return null; }]; + var a = [t, t];// T[] + var b = [t, null];// T[] + var c = [t, u];// {}[] + var d = [t, 1];// {}[] + var e = [function () { return t; }, function () { return u; }];// {}[] + var f = [function () { return t; }, function () { return u; }, function () { return null; }];// { (): any }[] } function foo2(t, u) { - var a = [t, t]; - var b = [t, null]; - var c = [t, u]; - var d = [t, 1]; - var e = [function () { return t; }, function () { return u; }]; - var f = [function () { return t; }, function () { return u; }, function () { return null; }]; - var g = [t, base]; - var h = [t, derived]; - var i = [u, base]; - var j = [u, derived]; + var a = [t, t];// T[] + var b = [t, null];// T[] + var c = [t, u];// {}[] + var d = [t, 1];// {}[] + var e = [function () { return t; }, function () { return u; }];// {}[] + var f = [function () { return t; }, function () { return u; }, function () { return null; }];// { (): any }[] + var g = [t, base];// Base[] + var h = [t, derived];// Derived[] + var i = [u, base];// Base[] + var j = [u, derived];// Derived[] } function foo3(t, u) { - var a = [t, t]; - var b = [t, null]; - var c = [t, u]; - var d = [t, 1]; - var e = [function () { return t; }, function () { return u; }]; - var f = [function () { return t; }, function () { return u; }, function () { return null; }]; - var g = [t, base]; - var h = [t, derived]; - var i = [u, base]; - var j = [u, derived]; + var a = [t, t];// T[] + var b = [t, null];// T[] + var c = [t, u];// {}[] + var d = [t, 1];// {}[] + var e = [function () { return t; }, function () { return u; }];// {}[] + var f = [function () { return t; }, function () { return u; }, function () { return null; }];// { (): any }[] + var g = [t, base];// Base[] + var h = [t, derived];// Derived[] + var i = [u, base];// Base[] + var j = [u, derived];// Derived[] } function foo4(t, u) { - var a = [t, t]; - var b = [t, null]; - var c = [t, u]; - var d = [t, 1]; - var e = [function () { return t; }, function () { return u; }]; - var f = [function () { return t; }, function () { return u; }, function () { return null; }]; - var g = [t, base]; - var h = [t, derived]; - var i = [u, base]; - var j = [u, derived]; + var a = [t, t];// T[] + var b = [t, null];// T[] + var c = [t, u];// BUG 821629 + var d = [t, 1];// {}[] + var e = [function () { return t; }, function () { return u; }];// {}[] + var f = [function () { return t; }, function () { return u; }, function () { return null; }];// { (): any }[] + var g = [t, base];// Base[] + var h = [t, derived];// Derived[] + var i = [u, base];// Base[] + var j = [u, derived];// Derived[] var k = [t, u]; } diff --git a/tests/baselines/reference/implementPublicPropertyAsPrivate.js b/tests/baselines/reference/implementPublicPropertyAsPrivate.js index 0a57704553f..613bcc71722 100644 --- a/tests/baselines/reference/implementPublicPropertyAsPrivate.js +++ b/tests/baselines/reference/implementPublicPropertyAsPrivate.js @@ -9,7 +9,7 @@ class C implements I { //// [implementPublicPropertyAsPrivate.js] var C = (function () { function C() { - this.x = 0; + this.x = 0;// should raise error at class decl } return C; })(); diff --git a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js index 34b84a9f44f..35a24d32aaf 100644 --- a/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js +++ b/tests/baselines/reference/implementingAnInterfaceExtendingClassWithPrivates2.js @@ -179,8 +179,8 @@ var M2; })(Foo); var b; var r1 = b.z; - var r2 = b.x; - var r3 = b.y; + var r2 = b.x;// error + var r3 = b.y;// error var Bar2 = (function (_super) { __extends(Bar2, _super); function Bar2() { diff --git a/tests/baselines/reference/implicitAnyDeclareFunctionExprWithoutFormalType.js b/tests/baselines/reference/implicitAnyDeclareFunctionExprWithoutFormalType.js index 33dad54f8ea..fd9668952b7 100644 --- a/tests/baselines/reference/implicitAnyDeclareFunctionExprWithoutFormalType.js +++ b/tests/baselines/reference/implicitAnyDeclareFunctionExprWithoutFormalType.js @@ -20,9 +20,9 @@ var lambda10 = function temp1() { return 5; } //// [implicitAnyDeclareFunctionExprWithoutFormalType.js] // these should be errors for implicit any parameter var lambda = function (l1) { -}; +};// Error at "l1" var lambd2 = function (ll1, ll2) { -}; +}// Error at "ll1" // Error at "ll1" ;// Error at "ll1" var lamda3 = function myLambda3(myParam) { }; var lamda4 = function () { diff --git a/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.js b/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.js index 8a413ad1737..37b4d63b4f5 100644 --- a/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.js +++ b/tests/baselines/reference/implicitAnyDeclareMemberWithoutType2.js @@ -13,9 +13,9 @@ class C { // this should be an error var C = (function () { function C(c1, c2, c3) { - this.x = null; - } + this.x = null;// error at "x" + }// error at "c1, c2" C.prototype.funcOfC = function (f1, f2, f3) { - }; + };// error at "f1,f2" return C; })(); diff --git a/tests/baselines/reference/implicitAnyDeclareTypePropertyWithoutType.js b/tests/baselines/reference/implicitAnyDeclareTypePropertyWithoutType.js index 8e9f91fa138..d4b9e29701e 100644 --- a/tests/baselines/reference/implicitAnyDeclareTypePropertyWithoutType.js +++ b/tests/baselines/reference/implicitAnyDeclareTypePropertyWithoutType.js @@ -24,11 +24,11 @@ var C = (function () { return C; })(); // this should be an error -var x; -var x1; -var x11; -var x2; -var x3; +var x// error at "y,z" ;// error at "y,z" +var x1;// error at "z1" +var x11;// error at "new" +var x2;// error at "y2" +var x3;// error at "y3" // this should not be an error var bar; var foo; diff --git a/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.js b/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.js index fd2bb9e103f..fbf5e8b0276 100644 --- a/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.js +++ b/tests/baselines/reference/implicitAnyDeclareVariablesWithoutTypeAndInit.js @@ -13,7 +13,7 @@ var x1: any; var y1 = new x1; //// [implicitAnyDeclareVariablesWithoutTypeAndInit.js] // this should be an error -var x; +var x;// error at "x" function func(k) { } ; diff --git a/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.js b/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.js index eeb13957cdf..acf9b46a818 100644 --- a/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.js +++ b/tests/baselines/reference/implicitAnyFunctionInvocationWithAnyArguements.js @@ -37,12 +37,12 @@ var newC2 = new C([], null) //// [implicitAnyFunctionInvocationWithAnyArguements.js] // this should be errors -var arg0 = null; -var anyArray = [null, undefined]; -var objL; +var arg0 = null;// error at "arg0" +var anyArray = [null, undefined];// error at array literal +var objL// error at "y,z" ;// error at "y,z" var funcL; function temp1(arg1) { -} +}// error at "temp1" function testFunctionExprC(subReplace) { } function testFunctionExprC2(eq) { diff --git a/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.js b/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.js index 6195d17970d..025c4aac13d 100644 --- a/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.js +++ b/tests/baselines/reference/implicitAnyFunctionReturnNullOrUndefined.js @@ -28,10 +28,10 @@ undefinedWidenFunction(); // this should be an error function nullWidenFunction() { return null; -} +}// error at "nullWidenFunction" function undefinedWidenFunction() { return undefined; -} +}// error at "undefinedWidenFunction" var C = (function () { function C() { } diff --git a/tests/baselines/reference/implicitAnyNewExprLackConstructorSignature.js b/tests/baselines/reference/implicitAnyNewExprLackConstructorSignature.js index c48d967dc9b..8758b6e1c41 100644 --- a/tests/baselines/reference/implicitAnyNewExprLackConstructorSignature.js +++ b/tests/baselines/reference/implicitAnyNewExprLackConstructorSignature.js @@ -6,4 +6,4 @@ var x: any = new Point(); // error at "new" function Point() { this.x = 3; } -var x = new Point(); +var x = new Point();// error at "new" diff --git a/tests/baselines/reference/implicitAnyWidenToAny.js b/tests/baselines/reference/implicitAnyWidenToAny.js index 75b34cee969..be6c2ba02fc 100644 --- a/tests/baselines/reference/implicitAnyWidenToAny.js +++ b/tests/baselines/reference/implicitAnyWidenToAny.js @@ -29,10 +29,10 @@ var obj1 = anyReturnFunc(); //// [implicitAnyWidenToAny.js] // these should be errors -var x = null; -var x1 = undefined; -var widenArray = [null, undefined]; -var emptyArray = []; +var x = null;// error at "x" +var x1 = undefined;// error at "x1" +var widenArray = [null, undefined];// error at "widenArray" +var emptyArray = [];// error at "emptyArray" // these should not be error var AnimalObj = (function () { function AnimalObj() { diff --git a/tests/baselines/reference/importDecl.js b/tests/baselines/reference/importDecl.js index 5073753f3cb..58f423ae75e 100644 --- a/tests/baselines/reference/importDecl.js +++ b/tests/baselines/reference/importDecl.js @@ -140,7 +140,7 @@ exports.foo2 = foo2; /// /// /// -var m4 = require("importDecl_require"); +var m4 = require("importDecl_require");// Emit used exports.x4 = m4.x; exports.d4 = m4.d; exports.f4 = m4.foo(); @@ -172,7 +172,7 @@ var usePrivate_m4_m1 = exports.usePrivate_m4_m1; var m5 = require("importDecl_require4"); exports.d = m5.foo2(); // Do not emit multiple used import statements -var multiImport_m4 = require("importDecl_require"); +var multiImport_m4 = require("importDecl_require");// Emit used exports.useMultiImport_m4_x4 = multiImport_m4.x; exports.useMultiImport_m4_d4 = multiImport_m4.d; exports.useMultiImport_m4_f4 = multiImport_m4.foo(); diff --git a/tests/baselines/reference/importImportOnlyModule.js b/tests/baselines/reference/importImportOnlyModule.js index 31efc6698f8..a003a3f2a03 100644 --- a/tests/baselines/reference/importImportOnlyModule.js +++ b/tests/baselines/reference/importImportOnlyModule.js @@ -28,9 +28,9 @@ define(["require", "exports"], function (require, exports) { }); //// [foo_1.js] define(["require", "exports"], function (require, exports) { - var answer = 42; + var answer = 42;// No exports }); //// [foo_2.js] define(["require", "exports", "./foo_1"], function (require, exports, foo) { - var x = foo; + var x = foo;// Cause a runtime dependency }); diff --git a/tests/baselines/reference/importOnAliasedIdentifiers.js b/tests/baselines/reference/importOnAliasedIdentifiers.js index 8f92bed3350..4d6607d936b 100644 --- a/tests/baselines/reference/importOnAliasedIdentifiers.js +++ b/tests/baselines/reference/importOnAliasedIdentifiers.js @@ -17,6 +17,6 @@ var A; })(A || (A = {})); var B; (function (B) { - var Z = A.X; + var Z = A.X;// Alias for both type and member A.X var v = Z; })(B || (B = {})); diff --git a/tests/baselines/reference/importTsBeforeDTs.js b/tests/baselines/reference/importTsBeforeDTs.js index 44908ac8d8f..63afde26bdc 100644 --- a/tests/baselines/reference/importTsBeforeDTs.js +++ b/tests/baselines/reference/importTsBeforeDTs.js @@ -17,5 +17,5 @@ var z2 = foo.y + 10; // Should resolve exports.y = 42; //// [foo_1.js] var foo = require("./foo_0"); -var z1 = foo.x + 10; -var z2 = foo.y + 10; +var z1 = foo.x + 10;// Should error, as .ts preferred over .d.ts +var z2 = foo.y + 10;// Should resolve diff --git a/tests/baselines/reference/indexIntoArraySubclass.js b/tests/baselines/reference/indexIntoArraySubclass.js index 051ec813465..b9020f6261f 100644 --- a/tests/baselines/reference/indexIntoArraySubclass.js +++ b/tests/baselines/reference/indexIntoArraySubclass.js @@ -6,5 +6,5 @@ r = 0; //error //// [indexIntoArraySubclass.js] var x2; -var r = x2[0]; +var r = x2[0];// string r = 0; diff --git a/tests/baselines/reference/indexSignatureTypeInference.js b/tests/baselines/reference/indexSignatureTypeInference.js index a4f79801258..6b80b1e59e9 100644 --- a/tests/baselines/reference/indexSignatureTypeInference.js +++ b/tests/baselines/reference/indexSignatureTypeInference.js @@ -24,7 +24,7 @@ var v1 = stringMapToArray(stringMap); // Ok var numberMap; var stringMap; var v1; -var v1 = numberMapToArray(numberMap); -var v1 = numberMapToArray(stringMap); -var v1 = stringMapToArray(numberMap); -var v1 = stringMapToArray(stringMap); +var v1 = numberMapToArray(numberMap);// Ok +var v1 = numberMapToArray(stringMap);// Ok +var v1 = stringMapToArray(numberMap);// Error expected here +var v1 = stringMapToArray(stringMap);// Ok diff --git a/tests/baselines/reference/indexSignaturesInferentialTyping.js b/tests/baselines/reference/indexSignaturesInferentialTyping.js index c9cc7293a1a..93596031b11 100644 --- a/tests/baselines/reference/indexSignaturesInferentialTyping.js +++ b/tests/baselines/reference/indexSignaturesInferentialTyping.js @@ -15,7 +15,7 @@ function foo(items) { function bar(items) { return undefined; } -var x1 = foo({ 0: 0, 1: 1 }); +var x1 = foo({ 0: 0, 1: 1 });// type should be number var x2 = foo({ zero: 0, one: 1 }); var x3 = bar({ 0: 0, 1: 1 }); -var x4 = bar({ zero: 0, one: 1 }); +var x4 = bar({ zero: 0, one: 1 });// type should be number diff --git a/tests/baselines/reference/indexer3.js b/tests/baselines/reference/indexer3.js index 85637e2ef20..7b84415d1c8 100644 --- a/tests/baselines/reference/indexer3.js +++ b/tests/baselines/reference/indexer3.js @@ -4,4 +4,4 @@ var r: Date = dateMap["hello"] // result type includes indexer using BCT //// [indexer3.js] var dateMap = {}; -var r = dateMap["hello"]; +var r = dateMap["hello"]// result type includes indexer using BCT ;// result type includes indexer using BCT diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.js b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.js index e3150d457c1..1f0fc9871a1 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.js +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeZip.js @@ -8,4 +8,4 @@ var i = result[0].x; // number var pair; var zipWith; var result = zipWith([1, 2], ['a', 'b'], pair); -var i = result[0].x; +var i = result[0].x;// number diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js index ca5f5c497b8..e93ad4cb886 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod1.js @@ -27,6 +27,6 @@ var B = (function (_super) { return B; })(A); var a = new A(); -var b1 = new B(); -var b2 = new B(); -var b3 = new B(); +var b1 = new B();// no error +var b2 = new B();// no error +var b3 = new B();// error, could not select overload for 'new' expression diff --git a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js index 0e2fc8c7322..c393e9a1c39 100644 --- a/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js +++ b/tests/baselines/reference/inheritanceOfGenericConstructorMethod2.js @@ -55,7 +55,7 @@ var N; })(M.C2); N.D2 = D2; })(N || (N = {})); -var c = new M.C2(); -var n = new N.D1(); -var n2 = new N.D2(); -var n3 = new N.D2(); +var c = new M.C2();// no error +var n = new N.D1();// no error +var n2 = new N.D2();// error +var n3 = new N.D2();// no error, D2 diff --git a/tests/baselines/reference/innerOverloads.js b/tests/baselines/reference/innerOverloads.js index 3249ca0da26..e473d822727 100644 --- a/tests/baselines/reference/innerOverloads.js +++ b/tests/baselines/reference/innerOverloads.js @@ -19,4 +19,4 @@ function outer() { } return inner(0); } -var x = outer(); +var x = outer();// should work diff --git a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.js b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.js index 8ba9f1ea983..3f5203de077 100644 --- a/tests/baselines/reference/instanceMemberAssignsToClassPrototype.js +++ b/tests/baselines/reference/instanceMemberAssignsToClassPrototype.js @@ -22,7 +22,7 @@ var C = (function () { }; C.prototype.bar = function (x) { C.prototype.bar = function () { - }; + }// error ; C.prototype.bar = function (x) { return x; }; C.prototype.bar = function (x) { return 1; }; return 1; diff --git a/tests/baselines/reference/interfaceAssignmentCompat.js b/tests/baselines/reference/interfaceAssignmentCompat.js index d85dae45159..7ee958c16de 100644 --- a/tests/baselines/reference/interfaceAssignmentCompat.js +++ b/tests/baselines/reference/interfaceAssignmentCompat.js @@ -77,7 +77,7 @@ var M; x[2] = { color: 0 /* Green */ }; x = x.sort(CompareYeux); // type of z inferred from specialized array type - var z = x.sort(CompareEyes); + var z = x.sort(CompareEyes);// ok for (var i = 0, len = z.length; i < len; i++) { result += ((Color._map[z[i].color]) + "\r\n"); } diff --git a/tests/baselines/reference/interfaceExtendingClassWithPrivates.js b/tests/baselines/reference/interfaceExtendingClassWithPrivates.js index 5304068fdd8..ab3f2ef22d9 100644 --- a/tests/baselines/reference/interfaceExtendingClassWithPrivates.js +++ b/tests/baselines/reference/interfaceExtendingClassWithPrivates.js @@ -23,4 +23,4 @@ var Foo = (function () { })(); var i; var r = i.y; -var r2 = i.x; +var r2 = i.x;// error diff --git a/tests/baselines/reference/interfaceExtendingClassWithPrivates2.js b/tests/baselines/reference/interfaceExtendingClassWithPrivates2.js index 06c1c040a96..10514413003 100644 --- a/tests/baselines/reference/interfaceExtendingClassWithPrivates2.js +++ b/tests/baselines/reference/interfaceExtendingClassWithPrivates2.js @@ -45,5 +45,5 @@ var Baz = (function () { })(); var i; var r = i.z; -var r2 = i.x; -var r3 = i.y; +var r2 = i.x;// error +var r3 = i.y;// error diff --git a/tests/baselines/reference/intrinsics.js b/tests/baselines/reference/intrinsics.js index c1cea70db86..29da13175e5 100644 --- a/tests/baselines/reference/intrinsics.js +++ b/tests/baselines/reference/intrinsics.js @@ -16,7 +16,7 @@ class Foo<__proto__> { } var foo: (__proto__: number) => void; //// [intrinsics.js] -var hasOwnProperty; +var hasOwnProperty;// Error var m1; (function (m1) { m1.__proto__; diff --git a/tests/baselines/reference/invalidBooleanAssignments.js b/tests/baselines/reference/invalidBooleanAssignments.js index 803f553c4d2..99b33bbc93c 100644 --- a/tests/baselines/reference/invalidBooleanAssignments.js +++ b/tests/baselines/reference/invalidBooleanAssignments.js @@ -45,7 +45,7 @@ var C = (function () { var f = x; var g = x; var h = x; -var h2 = x; +var h2 = x;// no error var M; (function (M) { M.a = 1; diff --git a/tests/baselines/reference/invalidInstantiatedModule.js b/tests/baselines/reference/invalidInstantiatedModule.js index c180d1c7b4a..ea26d2263d1 100644 --- a/tests/baselines/reference/invalidInstantiatedModule.js +++ b/tests/baselines/reference/invalidInstantiatedModule.js @@ -24,11 +24,11 @@ var M; return Point; })(); M.Point = Point; - M.Point = 1; + M.Point = 1;// Error })(M || (M = {})); var M2; (function (M2) { M2.Point = 1; })(M2 || (M2 = {})); var m = M2; -var p; +var p;// Error diff --git a/tests/baselines/reference/invalidNestedModules.js b/tests/baselines/reference/invalidNestedModules.js index ece1aeeaa7f..9ba817885ed 100644 --- a/tests/baselines/reference/invalidNestedModules.js +++ b/tests/baselines/reference/invalidNestedModules.js @@ -72,7 +72,7 @@ var M2; var M2; (function (M2) { (function (X) { - X.Point; + X.Point;// Error })(M2.X || (M2.X = {})); var X = M2.X; })(M2 || (M2 = {})); diff --git a/tests/baselines/reference/invalidReturnStatements.js b/tests/baselines/reference/invalidReturnStatements.js index 26e96e82df5..b7394e95823 100644 --- a/tests/baselines/reference/invalidReturnStatements.js +++ b/tests/baselines/reference/invalidReturnStatements.js @@ -37,7 +37,7 @@ function fn3() { function fn4() { } function fn7() { -} +}// should be valid: any includes void var C = (function () { function C() { } diff --git a/tests/baselines/reference/invalidSymbolInTypeParameter1.js b/tests/baselines/reference/invalidSymbolInTypeParameter1.js index 1530b506867..c198bed62ce 100644 --- a/tests/baselines/reference/invalidSymbolInTypeParameter1.js +++ b/tests/baselines/reference/invalidSymbolInTypeParameter1.js @@ -6,5 +6,5 @@ function test() { //// [invalidSymbolInTypeParameter1.js] function test() { - var cats = new Array(); + var cats = new Array();// WAWA is not a valid type } diff --git a/tests/baselines/reference/logicalOrOperatorWithEveryType.js b/tests/baselines/reference/logicalOrOperatorWithEveryType.js index 31d19c5a802..593e084b20a 100644 --- a/tests/baselines/reference/logicalOrOperatorWithEveryType.js +++ b/tests/baselines/reference/logicalOrOperatorWithEveryType.js @@ -144,103 +144,103 @@ var a5; var a6; var a7; var a8; -var ra1 = a1 || a1; -var ra2 = a2 || a1; -var ra3 = a3 || a1; -var ra4 = a4 || a1; -var ra5 = a5 || a1; -var ra6 = a6 || a1; -var ra7 = a7 || a1; -var ra8 = a8 || a1; -var ra9 = null || a1; -var ra10 = undefined || a1; -var rb1 = a1 || a2; -var rb2 = a2 || a2; -var rb3 = a3 || a2; -var rb4 = a4 || a2; -var rb5 = a5 || a2; -var rb6 = a6 || a2; -var rb7 = a7 || a2; -var rb8 = a8 || a2; -var rb9 = null || a2; -var rb10 = undefined || a2; -var rc1 = a1 || a3; -var rc2 = a2 || a3; -var rc3 = a3 || a3; -var rc4 = a4 || a3; -var rc5 = a5 || a3; -var rc6 = a6 || a3; -var rc7 = a7 || a3; -var rc8 = a8 || a3; -var rc9 = null || a3; -var rc10 = undefined || a3; -var rd1 = a1 || a4; -var rd2 = a2 || a4; -var rd3 = a3 || a4; -var rd4 = a4 || a4; -var rd5 = a5 || a4; -var rd6 = a6 || a4; -var rd7 = a7 || a4; -var rd8 = a8 || a4; -var rd9 = null || a4; -var rd10 = undefined || a4; -var re1 = a1 || a5; -var re2 = a2 || a5; -var re3 = a3 || a5; -var re4 = a4 || a5; -var re5 = a5 || a5; -var re6 = a6 || a5; -var re7 = a7 || a5; -var re8 = a8 || a5; -var re9 = null || a5; -var re10 = undefined || a5; -var rg1 = a1 || a6; -var rg2 = a2 || a6; -var rg3 = a3 || a6; -var rg4 = a4 || a6; -var rg5 = a5 || a6; -var rg6 = a6 || a6; -var rg7 = a7 || a6; -var rg8 = a8 || a6; -var rg9 = null || a6; -var rg10 = undefined || a6; -var rh1 = a1 || a7; -var rh2 = a2 || a7; -var rh3 = a3 || a7; -var rh4 = a4 || a7; -var rh5 = a5 || a7; -var rh6 = a6 || a7; -var rh7 = a7 || a7; -var rh8 = a8 || a7; -var rh9 = null || a7; -var rh10 = undefined || a7; -var ri1 = a1 || a8; -var ri2 = a2 || a8; -var ri3 = a3 || a8; -var ri4 = a4 || a8; -var ri5 = a5 || a8; -var ri6 = a6 || a8; -var ri7 = a7 || a8; -var ri8 = a8 || a8; -var ri9 = null || a8; -var ri10 = undefined || a8; -var rj1 = a1 || null; -var rj2 = a2 || null; -var rj3 = a3 || null; -var rj4 = a4 || null; -var rj5 = a5 || null; -var rj6 = a6 || null; -var rj7 = a7 || null; -var rj8 = a8 || null; -var rj9 = null || null; -var rj10 = undefined || null; -var rf1 = a1 || undefined; -var rf2 = a2 || undefined; -var rf3 = a3 || undefined; -var rf4 = a4 || undefined; -var rf5 = a5 || undefined; -var rf6 = a6 || undefined; -var rf7 = a7 || undefined; -var rf8 = a8 || undefined; -var rf9 = null || undefined; -var rf10 = undefined || undefined; +var ra1 = a1 || a1;// any || any is any +var ra2 = a2 || a1;// boolean || any is any +var ra3 = a3 || a1;// number || any is any +var ra4 = a4 || a1;// string || any is any +var ra5 = a5 || a1;// void || any is any +var ra6 = a6 || a1;// enum || any is any +var ra7 = a7 || a1;// object || any is any +var ra8 = a8 || a1;// array || any is any +var ra9 = null || a1;// null || any is any +var ra10 = undefined || a1;// undefined || any is any +var rb1 = a1 || a2;// any || boolean is any +var rb2 = a2 || a2;// boolean || boolean is boolean +var rb3 = a3 || a2;// number || boolean is {} +var rb4 = a4 || a2;// string || boolean is {} +var rb5 = a5 || a2;// void || boolean is {} +var rb6 = a6 || a2;// enum || boolean is {} +var rb7 = a7 || a2;// object || boolean is {} +var rb8 = a8 || a2;// array || boolean is {} +var rb9 = null || a2;// null || boolean is boolean +var rb10 = undefined || a2;// undefined || boolean is boolean +var rc1 = a1 || a3;// any || number is any +var rc2 = a2 || a3;// boolean || number is {} +var rc3 = a3 || a3;// number || number is number +var rc4 = a4 || a3;// string || number is {} +var rc5 = a5 || a3;// void || number is {} +var rc6 = a6 || a3;// enum || number is number +var rc7 = a7 || a3;// object || number is {} +var rc8 = a8 || a3;// array || number is {} +var rc9 = null || a3;// null || number is number +var rc10 = undefined || a3;// undefined || number is number +var rd1 = a1 || a4;// any || string is any +var rd2 = a2 || a4;// boolean || string is {} +var rd3 = a3 || a4;// number || string is {} +var rd4 = a4 || a4;// string || string is string +var rd5 = a5 || a4;// void || string is {} +var rd6 = a6 || a4;// enum || string is {} +var rd7 = a7 || a4;// object || string is {} +var rd8 = a8 || a4;// array || string is {} +var rd9 = null || a4;// null || string is string +var rd10 = undefined || a4;// undefined || string is string +var re1 = a1 || a5;// any || void is any +var re2 = a2 || a5;// boolean || void is {} +var re3 = a3 || a5;// number || void is {} +var re4 = a4 || a5;// string || void is {} +var re5 = a5 || a5;// void || void is void +var re6 = a6 || a5;// enum || void is {} +var re7 = a7 || a5;// object || void is {} +var re8 = a8 || a5;// array || void is {} +var re9 = null || a5;// null || void is void +var re10 = undefined || a5;// undefined || void is void +var rg1 = a1 || a6;// any || enum is any +var rg2 = a2 || a6;// boolean || enum is {} +var rg3 = a3 || a6;// number || enum is number +var rg4 = a4 || a6;// string || enum is {} +var rg5 = a5 || a6;// void || enum is {} +var rg6 = a6 || a6;// enum || enum is E +var rg7 = a7 || a6;// object || enum is {} +var rg8 = a8 || a6;// array || enum is {} +var rg9 = null || a6;// null || enum is E +var rg10 = undefined || a6;// undefined || enum is E +var rh1 = a1 || a7;// any || object is any +var rh2 = a2 || a7;// boolean || object is {} +var rh3 = a3 || a7;// number || object is {} +var rh4 = a4 || a7;// string || object is {} +var rh5 = a5 || a7;// void || object is {} +var rh6 = a6 || a7;// enum || object is {} +var rh7 = a7 || a7;// object || object is object +var rh8 = a8 || a7;// array || object is {} +var rh9 = null || a7;// null || object is object +var rh10 = undefined || a7;// undefined || object is object +var ri1 = a1 || a8;// any || array is any +var ri2 = a2 || a8;// boolean || array is {} +var ri3 = a3 || a8;// number || array is {} +var ri4 = a4 || a8;// string || array is {} +var ri5 = a5 || a8;// void || array is {} +var ri6 = a6 || a8;// enum || array is {} +var ri7 = a7 || a8;// object || array is {} +var ri8 = a8 || a8;// array || array is array +var ri9 = null || a8;// null || array is array +var ri10 = undefined || a8;// undefined || array is array +var rj1 = a1 || null;// any || null is any +var rj2 = a2 || null;// boolean || null is boolean +var rj3 = a3 || null;// number || null is number +var rj4 = a4 || null;// string || null is string +var rj5 = a5 || null;// void || null is void +var rj6 = a6 || null;// enum || null is E +var rj7 = a7 || null;// object || null is object +var rj8 = a8 || null;// array || null is array +var rj9 = null || null;// null || null is any +var rj10 = undefined || null;// undefined || null is any +var rf1 = a1 || undefined;// any || undefined is any +var rf2 = a2 || undefined;// boolean || undefined is boolean +var rf3 = a3 || undefined;// number || undefined is number +var rf4 = a4 || undefined;// string || undefined is string +var rf5 = a5 || undefined;// void || undefined is void +var rf6 = a6 || undefined;// enum || undefined is E +var rf7 = a7 || undefined;// object || undefined is object +var rf8 = a8 || undefined;// array || undefined is array +var rf9 = null || undefined;// null || undefined is any +var rf10 = undefined || undefined;// undefined || undefined is any diff --git a/tests/baselines/reference/memberFunctionsWithPrivateOverloads.js b/tests/baselines/reference/memberFunctionsWithPrivateOverloads.js index cfd5d46a4a1..bb8f163cecc 100644 --- a/tests/baselines/reference/memberFunctionsWithPrivateOverloads.js +++ b/tests/baselines/reference/memberFunctionsWithPrivateOverloads.js @@ -77,8 +77,8 @@ var D = (function () { return D; })(); var c; -var r = c.foo(1); +var r = c.foo(1);// error var d; -var r2 = d.foo(2); -var r3 = C.foo(1); -var r4 = D.bar(''); +var r2 = d.foo(2);// error +var r3 = C.foo(1);// error +var r4 = D.bar('');// error diff --git a/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js b/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js index 2f4ff52b541..a4d26042026 100644 --- a/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js +++ b/tests/baselines/reference/memberFunctionsWithPublicPrivateOverloads.js @@ -73,6 +73,6 @@ var D = (function () { return D; })(); var c; -var r = c.foo(1); +var r = c.foo(1);// error var d; -var r2 = d.foo(2); +var r2 = d.foo(2);// error diff --git a/tests/baselines/reference/mergeThreeInterfaces.js b/tests/baselines/reference/mergeThreeInterfaces.js index bea7efa1eb6..b01e3d581a4 100644 --- a/tests/baselines/reference/mergeThreeInterfaces.js +++ b/tests/baselines/reference/mergeThreeInterfaces.js @@ -93,13 +93,13 @@ var M; var a; var r1 = a.foo; // BUG 856491 - var r2 = a.bar; + var r2 = a.bar;// any, should be number // BUG 856491 - var r3 = a.baz; + var r3 = a.baz;// any, should be boolean var b; var r4 = b.foo; // BUG 856491 - var r5 = b.bar; + var r5 = b.bar;// any, should be number // BUG 856491 - var r6 = b.baz; + var r6 = b.baz;// any, should be boolean })(M || (M = {})); diff --git a/tests/baselines/reference/mergeTwoInterfaces.js b/tests/baselines/reference/mergeTwoInterfaces.js index 03e26daacb0..c71ca36bc05 100644 --- a/tests/baselines/reference/mergeTwoInterfaces.js +++ b/tests/baselines/reference/mergeTwoInterfaces.js @@ -70,9 +70,9 @@ var M; var a; var r1 = a.foo; // BUG 856491 - var r2 = a.bar; + var r2 = a.bar;// any, should be number var b; var r3 = b.foo; // BUG 856491 - var r4 = b.bar; + var r4 = b.bar;// any, should be string })(M || (M = {})); diff --git a/tests/baselines/reference/mergedDeclarations3.js b/tests/baselines/reference/mergedDeclarations3.js index 2c606288a98..fcd99d4b7a8 100644 --- a/tests/baselines/reference/mergedDeclarations3.js +++ b/tests/baselines/reference/mergedDeclarations3.js @@ -55,7 +55,7 @@ var M; })(M.Color || (M.Color = {})); var Color = M.Color; })(M || (M = {})); -var p = M.Color.Blue; +var p = M.Color.Blue;// ok var M; (function (M) { function foo() { diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.js index 527df77b0c6..ff5c2e5e910 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.js +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates.js @@ -43,4 +43,4 @@ var E = (function () { return E; })(); var a; -var r = a.x; +var r = a.x;// error diff --git a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js index 98fa868bb53..75552123289 100644 --- a/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js +++ b/tests/baselines/reference/mergedInterfacesWithInheritedPrivates2.js @@ -63,5 +63,5 @@ var E = (function (_super) { return E; })(C2); var a; -var r = a.x; -var r2 = a.w; +var r = a.x;// error +var r2 = a.w;// error diff --git a/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js b/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js index fab0f72dada..c5c05f034c0 100644 --- a/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js +++ b/tests/baselines/reference/mergedModuleDeclarationCodeGen5.js @@ -52,12 +52,12 @@ var M; })(_plop.plop || (_plop.plop = {})); var plop = _plop.plop; // Emit these references as follows - var v1 = gunk; - var v2 = buz; - _plop.v3 = _plop.doom; - _plop.v4 = _plop.M; - _plop.v5 = fudge; - _plop.v6 = plop; + var v1 = gunk;// gunk + var v2 = buz;// buz + _plop.v3 = _plop.doom;// _plop.doom + _plop.v4 = _plop.M;// _plop.M + _plop.v5 = fudge;// fudge + _plop.v6 = plop;// plop })(_buz.plop || (_buz.plop = {})); var plop = _buz.plop; })(M.buz || (M.buz = {})); diff --git a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.js b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.js index 64c801b5af4..56e3bda70df 100644 --- a/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.js +++ b/tests/baselines/reference/mismatchedExplicitTypeParameterAndArgumentType.js @@ -21,6 +21,6 @@ function map(xs, f) { var r0 = map([1, ""], function (x) { return x.toString(); }); var r5 = map([1, ""], function (x) { return x.toString(); }); var r6 = map([1, ""], function (x) { return x.toString(); }); -var r7 = map([1, ""], function (x) { return x.toString(); }); -var r7b = map([1, ""], function (x) { return x.toString(); }); +var r7 = map([1, ""], function (x) { return x.toString(); });// error +var r7b = map([1, ""], function (x) { return x.toString(); });// error var r8 = map([1, ""], function (x) { return x.toString(); }); diff --git a/tests/baselines/reference/moduleAliasInterface.js b/tests/baselines/reference/moduleAliasInterface.js index 194a195627d..02c08fe5495 100644 --- a/tests/baselines/reference/moduleAliasInterface.js +++ b/tests/baselines/reference/moduleAliasInterface.js @@ -72,7 +72,7 @@ var editor; // If you just use p1:modes, the compiler accepts it - should be an error var Bug = (function () { function Bug(p1, p2) { - } + }// should be an error on p2 - it's not exported Bug.prototype.foo = function (p1) { }; return Bug; @@ -84,7 +84,7 @@ var editor2; var i; var Bug = (function () { function Bug(p1, p2) { - } + }// no error here, since modesOuter is declared externally return Bug; })(); var Foo; diff --git a/tests/baselines/reference/moduleAndInterfaceWithSameName.js b/tests/baselines/reference/moduleAndInterfaceWithSameName.js index c88292bbb18..17d65c27fef 100644 --- a/tests/baselines/reference/moduleAndInterfaceWithSameName.js +++ b/tests/baselines/reference/moduleAndInterfaceWithSameName.js @@ -46,7 +46,7 @@ var Foo2; Bar.x = 42; })(Bar || (Bar = {})); })(Foo2 || (Foo2 = {})); -var z2 = Foo2.Bar.y; +var z2 = Foo2.Bar.y;// Error for using interface name as a value. var Foo3; (function (Foo3) { (function (Bar) { diff --git a/tests/baselines/reference/moduleNewExportBug.js b/tests/baselines/reference/moduleNewExportBug.js index 4fbc9e0ad25..0358d54703d 100644 --- a/tests/baselines/reference/moduleNewExportBug.js +++ b/tests/baselines/reference/moduleNewExportBug.js @@ -24,4 +24,4 @@ var mod1; return C; })(); })(mod1 || (mod1 = {})); -var c; +var c;// ERROR: C should not be visible diff --git a/tests/baselines/reference/moduleProperty2.js b/tests/baselines/reference/moduleProperty2.js index d8027d8d67b..5b7e3541e31 100644 --- a/tests/baselines/reference/moduleProperty2.js +++ b/tests/baselines/reference/moduleProperty2.js @@ -23,10 +23,10 @@ var M; var y; M.z; var test1 = x; - var test2 = y; + var test2 = y;// y visible because same module })(M || (M = {})); var N; (function (N) { - var test3 = M.y; - var test4 = M.z; + var test3 = M.y;// nope y private property of M + var test4 = M.z;// ok public property of M })(N || (N = {})); diff --git a/tests/baselines/reference/moduleScopingBug.js b/tests/baselines/reference/moduleScopingBug.js index 45ac72055a4..af47d5643ab 100644 --- a/tests/baselines/reference/moduleScopingBug.js +++ b/tests/baselines/reference/moduleScopingBug.js @@ -34,16 +34,16 @@ var M; (function (M) { var outer; function f() { - var inner = outer; + var inner = outer;// Ok } var C = (function () { function C() { - var inner = outer; + var inner = outer;// Ok } return C; })(); var X; (function (X) { - var inner = outer; + var inner = outer;// Error: outer not visible })(X || (X = {})); })(M || (M = {})); diff --git a/tests/baselines/reference/moduleUnassignedVariable.js b/tests/baselines/reference/moduleUnassignedVariable.js index 8a6866c3877..01851ddee79 100644 --- a/tests/baselines/reference/moduleUnassignedVariable.js +++ b/tests/baselines/reference/moduleUnassignedVariable.js @@ -14,9 +14,9 @@ var Bar; Bar.a = 1; function fooA() { return Bar.a; - } + }// Correct: return Bar.a Bar.b; function fooB() { return Bar.b; - } + }// Incorrect: return b })(Bar || (Bar = {})); diff --git a/tests/baselines/reference/moduleVariableArrayIndexer.js b/tests/baselines/reference/moduleVariableArrayIndexer.js index 47a2ba5158f..ae8382be600 100644 --- a/tests/baselines/reference/moduleVariableArrayIndexer.js +++ b/tests/baselines/reference/moduleVariableArrayIndexer.js @@ -9,5 +9,5 @@ module Bar { var Bar; (function (Bar) { Bar.a = 1; - var t = undefined[Bar.a][Bar.a]; + var t = undefined[Bar.a][Bar.a];// CG: var t = undefined[Bar.a][a]; })(Bar || (Bar = {})); diff --git a/tests/baselines/reference/moduleWithNoValuesAsType.js b/tests/baselines/reference/moduleWithNoValuesAsType.js index eeeabf23c71..f2bea35062a 100644 --- a/tests/baselines/reference/moduleWithNoValuesAsType.js +++ b/tests/baselines/reference/moduleWithNoValuesAsType.js @@ -16,6 +16,6 @@ module C { var c: C; // error //// [moduleWithNoValuesAsType.js] -var a; -var b; -var c; +var a;// error +var b;// error +var c;// error diff --git a/tests/baselines/reference/moduleWithValuesAsType.js b/tests/baselines/reference/moduleWithValuesAsType.js index ed1dc3d5487..87510d2c709 100644 --- a/tests/baselines/reference/moduleWithValuesAsType.js +++ b/tests/baselines/reference/moduleWithValuesAsType.js @@ -10,4 +10,4 @@ var A; (function (A) { var b = 1; })(A || (A = {})); -var a; +var a;// no error diff --git a/tests/baselines/reference/multiModuleFundule1.js b/tests/baselines/reference/multiModuleFundule1.js index bf2abfb7dc8..e0dccac6370 100644 --- a/tests/baselines/reference/multiModuleFundule1.js +++ b/tests/baselines/reference/multiModuleFundule1.js @@ -26,5 +26,5 @@ var C; C.foo = foo; })(C || (C = {})); var r = C(2); -var r2 = new C(2); +var r2 = new C(2);// using void returning function as constructor var r3 = C.foo(); diff --git a/tests/baselines/reference/nameCollisions.js b/tests/baselines/reference/nameCollisions.js index 0591989adbb..e2ab9dedb98 100644 --- a/tests/baselines/reference/nameCollisions.js +++ b/tests/baselines/reference/nameCollisions.js @@ -64,7 +64,7 @@ var T; (function (z) { var t; })(z || (z = {})); - var z; + var z;// error var y; (function (y) { var b; @@ -73,14 +73,14 @@ var T; function y() { } return y; - })(); + })();// error var w; var f; function f() { - } + }//error function f2() { } - var f2; + var f2;// error var i; var C = (function () { function C() { @@ -88,14 +88,14 @@ var T; return C; })(); function C() { - } + }// error function C2() { } var C2 = (function () { function C2() { } return C2; - })(); + })();// error function fi() { } var cli = (function () { @@ -107,5 +107,5 @@ var T; function cli2() { } return cli2; - })(); + })();// error })(T || (T = {})); diff --git a/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.js b/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.js index ea97d23f8d6..35b4f624899 100644 --- a/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.js +++ b/tests/baselines/reference/namedFunctionExpressionAssignedToClassProperty.js @@ -18,7 +18,7 @@ class Foo{ var Foo = (function () { function Foo() { this.a = function bar() { - }; + };// this shouldn't crash the compiler... } return Foo; })(); diff --git a/tests/baselines/reference/nestedModulePrivateAccess.js b/tests/baselines/reference/nestedModulePrivateAccess.js index fd6efb5e402..0694f1d3469 100644 --- a/tests/baselines/reference/nestedModulePrivateAccess.js +++ b/tests/baselines/reference/nestedModulePrivateAccess.js @@ -12,6 +12,6 @@ var a; var x; var b; (function (b) { - var y = x; + var y = x;// should not be an error })(b || (b = {})); })(a || (a = {})); diff --git a/tests/baselines/reference/nestedModules.js b/tests/baselines/reference/nestedModules.js index 147e6d43b49..832d282f888 100644 --- a/tests/baselines/reference/nestedModules.js +++ b/tests/baselines/reference/nestedModules.js @@ -36,7 +36,7 @@ var p: M2.X.Point; var A; (function (A) { (function (B) { - var Point = { x: 0, y: 0 }; + var Point = { x: 0, y: 0 };// bug 832088: could not find module 'C' })(A.B || (A.B = {})); var B = A.B; })(A || (A = {})); diff --git a/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.js b/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.js index f1e7136eb12..9007ab77c3b 100644 --- a/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.js +++ b/tests/baselines/reference/newExpressionWithTypeParameterConstrainedToOuterTypeParameter.js @@ -7,4 +7,4 @@ var y = new i(""); // y should be string //// [newExpressionWithTypeParameterConstrainedToOuterTypeParameter.js] var i; -var y = new i(""); +var y = new i("");// y should be string diff --git a/tests/baselines/reference/newNonReferenceType.js b/tests/baselines/reference/newNonReferenceType.js index 8647b2379a0..e4d4d0176aa 100644 --- a/tests/baselines/reference/newNonReferenceType.js +++ b/tests/baselines/reference/newNonReferenceType.js @@ -5,4 +5,4 @@ var b = new boolean(); // error //// [newNonReferenceType.js] var a = new any(); -var b = new boolean(); +var b = new boolean();// error diff --git a/tests/baselines/reference/newOnInstanceSymbol.js b/tests/baselines/reference/newOnInstanceSymbol.js index 428841de21b..10344f21d19 100644 --- a/tests/baselines/reference/newOnInstanceSymbol.js +++ b/tests/baselines/reference/newOnInstanceSymbol.js @@ -9,5 +9,5 @@ var C = (function () { } return C; })(); -var x = new C(); +var x = new C();// should be ok new x(); diff --git a/tests/baselines/reference/noErrorsInCallback.js b/tests/baselines/reference/noErrorsInCallback.js index 7cae7858db7..acfcaa194dc 100644 --- a/tests/baselines/reference/noErrorsInCallback.js +++ b/tests/baselines/reference/noErrorsInCallback.js @@ -15,7 +15,7 @@ var Bar = (function () { } return Bar; })(); -var one = new Bar({}); +var one = new Bar({});// Error [].forEach(function () { - var two = new Bar({}); + var two = new Bar({});// No error? }); diff --git a/tests/baselines/reference/noImplicitAnyForMethodParameters.js b/tests/baselines/reference/noImplicitAnyForMethodParameters.js index 2ddc8b3f86e..b8d906da5a8 100644 --- a/tests/baselines/reference/noImplicitAnyForMethodParameters.js +++ b/tests/baselines/reference/noImplicitAnyForMethodParameters.js @@ -19,13 +19,13 @@ var C = (function () { function C() { } C.prototype.foo = function (a) { - }; + };// OK - non-ambient class and private method - error return C; })(); var D = (function () { function D() { } D.prototype.foo = function (a) { - }; + };// OK - non-ambient class and public method - error return D; })(); diff --git a/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js index a5254b5ffff..79cc1194b29 100644 --- a/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js +++ b/tests/baselines/reference/nonGenericClassExtendingGenericClassWithAny.js @@ -23,4 +23,4 @@ var Bar = (function (_super) { _super.apply(this, arguments); } return Bar; -})(Foo); +})(Foo);// Valid diff --git a/tests/baselines/reference/nullAssignedToUndefined.js b/tests/baselines/reference/nullAssignedToUndefined.js index b91acd88c00..284fdcfb3d8 100644 --- a/tests/baselines/reference/nullAssignedToUndefined.js +++ b/tests/baselines/reference/nullAssignedToUndefined.js @@ -3,5 +3,5 @@ var x = undefined = null; // error var y: typeof undefined = null; // ok, widened //// [nullAssignedToUndefined.js] -var x = undefined = null; -var y = null; +var x = undefined = null;// error +var y = null;// ok, widened diff --git a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js index ae86031ca0c..4d9b45402d4 100644 --- a/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js +++ b/tests/baselines/reference/nullIsSubtypeOfEverythingButUndefined.js @@ -119,7 +119,7 @@ var r8 = true ? function (x) { } : null; var r8b = true ? null : function (x) { return x; -}; +};// type parameters not identical across declarations var i1; var r9 = true ? i1 : null; var r9 = true ? null : i1; diff --git a/tests/baselines/reference/numericIndexerConstraint1.js b/tests/baselines/reference/numericIndexerConstraint1.js index e587ed6753c..06a8082fc32 100644 --- a/tests/baselines/reference/numericIndexerConstraint1.js +++ b/tests/baselines/reference/numericIndexerConstraint1.js @@ -13,4 +13,4 @@ var Foo = (function () { return Foo; })(); var x; -var result = x["one"]; +var result = x["one"];// error diff --git a/tests/baselines/reference/numericIndexerTyping1.js b/tests/baselines/reference/numericIndexerTyping1.js index 7e4a1f07de5..5fd69a1f894 100644 --- a/tests/baselines/reference/numericIndexerTyping1.js +++ b/tests/baselines/reference/numericIndexerTyping1.js @@ -14,6 +14,6 @@ var r2: string = i2[1]; // error: numeric indexer returns the type of the string //// [numericIndexerTyping1.js] var i; -var r = i[1]; +var r = i[1];// error: numeric indexer returns the type of the string indexer var i2; -var r2 = i2[1]; +var r2 = i2[1];// error: numeric indexer returns the type of the string indexer diff --git a/tests/baselines/reference/numericIndexerTyping2.js b/tests/baselines/reference/numericIndexerTyping2.js index 6e6a9396be1..971e5c4417f 100644 --- a/tests/baselines/reference/numericIndexerTyping2.js +++ b/tests/baselines/reference/numericIndexerTyping2.js @@ -32,6 +32,6 @@ var I2 = (function (_super) { return I2; })(I); var i; -var r = i[1]; +var r = i[1];// error: numeric indexer returns the type of the string indexer var i2; -var r2 = i2[1]; +var r2 = i2[1];// error: numeric indexer returns the type of the string indexere diff --git a/tests/baselines/reference/objectLiteralArraySpecialization.js b/tests/baselines/reference/objectLiteralArraySpecialization.js index dc8ab70a1ab..8d049e43a56 100644 --- a/tests/baselines/reference/objectLiteralArraySpecialization.js +++ b/tests/baselines/reference/objectLiteralArraySpecialization.js @@ -9,5 +9,5 @@ thing.doSomething((x, y) => x.name === "bob"); // should not error //// [objectLiteralArraySpecialization.js] -var thing = create([{ name: "bob", id: 24 }, { name: "doug", id: 32 }]); +var thing = create([{ name: "bob", id: 24 }, { name: "doug", id: 32 }]);// should not error thing.doSomething(function (x, y) { return x.name === "bob"; }); diff --git a/tests/baselines/reference/objectLiteralIndexerErrors.js b/tests/baselines/reference/objectLiteralIndexerErrors.js index a0f57f23382..d7e23c846a1 100644 --- a/tests/baselines/reference/objectLiteralIndexerErrors.js +++ b/tests/baselines/reference/objectLiteralIndexerErrors.js @@ -18,5 +18,5 @@ o1 = { x: c, 0: a }; // string indexer is any, number indexer is A var a; var b; var c; -var o1 = { x: b, 0: a }; +var o1 = { x: b, 0: a };// both indexers are A o1 = { x: c, 0: a }; diff --git a/tests/baselines/reference/objectLiteralIndexers.js b/tests/baselines/reference/objectLiteralIndexers.js index f2d9ea63430..71ab0f742df 100644 --- a/tests/baselines/reference/objectLiteralIndexers.js +++ b/tests/baselines/reference/objectLiteralIndexers.js @@ -19,6 +19,6 @@ o1 = { x: c, 0: b }; // string indexer is any, number indexer is B var a; var b; var c; -var o1 = { x: a, 0: b }; +var o1 = { x: a, 0: b };// string indexer is A, number indexer is B o1 = { x: b, 0: c }; o1 = { x: c, 0: b }; diff --git a/tests/baselines/reference/objectLiteralReferencingInternalProperties.js b/tests/baselines/reference/objectLiteralReferencingInternalProperties.js index 9612144dbef..e06c0055492 100644 --- a/tests/baselines/reference/objectLiteralReferencingInternalProperties.js +++ b/tests/baselines/reference/objectLiteralReferencingInternalProperties.js @@ -2,4 +2,4 @@ var a = { b: 10, c: b }; // Should give error for attempting to reference b. //// [objectLiteralReferencingInternalProperties.js] -var a = { b: 10, c: b }; +var a = { b: 10, c: b };// Should give error for attempting to reference b. diff --git a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js index daa19478e69..de7375129e8 100644 --- a/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js +++ b/tests/baselines/reference/objectTypeHidingMembersOfExtendedObject.js @@ -83,13 +83,13 @@ var C = (function () { var c; var r1 = c.valueOf(); var r1b = c.data; -var r1c = r1b['hm']; -var r1d = c['hm']; +var r1c = r1b['hm'];// should be 'Object' +var r1d = c['hm'];// should be 'any' var i; var r2 = i.valueOf(); var r2b = i.data; -var r2c = r2b['hm']; -var r2d = i['hm']; +var r2c = r2b['hm'];// should be 'Object' +var r2d = i['hm'];// should be 'any' var a = { valueOf: function () { }, @@ -97,7 +97,7 @@ var a = { }; var r3 = a.valueOf(); var r3b = a.data; -var r3c = r3b['hm']; +var r3c = r3b['hm'];// should be 'Object' var r3d = i['hm']; var b; var r4 = b.valueOf(); diff --git a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.js b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.js index 6ab63424329..6fddcf21048 100644 --- a/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.js +++ b/tests/baselines/reference/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.js @@ -38,10 +38,10 @@ var r1 = i.apply; var r1b = i.call; var r1c = i.arguments; var r1d = i.data; -var r1e = i['hm']; +var r1e = i['hm'];// should be Object var x; var r2 = x.apply; var r2b = x.call; var r2c = x.arguments; var r2d = x.data; -var r2e = x['hm']; +var r2e = x['hm'];// should be Object diff --git a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.js b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.js index 33d9f067656..01a32274015 100644 --- a/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.js +++ b/tests/baselines/reference/objectTypeWithConstructSignatureHidingMembersOfExtendedFunction.js @@ -35,10 +35,10 @@ var r1 = i.apply; var r1b = i.call; var r1c = i.arguments; var r1d = i.data; -var r1e = i['hm']; +var r1e = i['hm'];// should be Object var x; var r2 = x.apply; var r2b = x.call; var r2c = x.arguments; var r2d = x.data; -var r2e = x['hm']; +var r2e = x['hm'];// should be Object diff --git a/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.js b/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.js index 59537954ab7..350b3c055d9 100644 --- a/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.js +++ b/tests/baselines/reference/objectTypeWithStringIndexerHidingObjectIndexer.js @@ -33,7 +33,7 @@ var r4: string = o2['']; //// [objectTypeWithStringIndexerHidingObjectIndexer.js] var o = {}; -var r = o['']; +var r = o[''];// should be Object var C = (function () { function C() { } diff --git a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.js b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.js index 2d290334276..287d1297252 100644 --- a/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.js +++ b/tests/baselines/reference/objectTypeWithStringNamedNumericProperty.js @@ -142,10 +142,10 @@ var r2 = c['.1']; var r3 = c['1']; var r3 = c[1]; var r4 = c['1.']; -var r3 = c[1.]; +var r3 = c[1.];// same as indexing by 1 when done numerically var r5 = c['1..']; var r6 = c['1.0']; -var r3 = c[1.0]; +var r3 = c[1.0];// same as indexing by 1 when done numerically // BUG 823822 var r7 = i[-1]; var r7 = i[-1.0]; @@ -161,10 +161,10 @@ var r2 = i['.1']; var r3 = i['1']; var r3 = c[1]; var r4 = i['1.']; -var r3 = c[1.]; +var r3 = c[1.];// same as indexing by 1 when done numerically var r5 = i['1..']; var r6 = i['1.0']; -var r3 = c[1.0]; +var r3 = c[1.0];// same as indexing by 1 when done numerically // BUG 823822 var r7 = i[-1]; var r7 = i[-1.0]; @@ -180,10 +180,10 @@ var r2 = a['.1']; var r3 = a['1']; var r3 = c[1]; var r4 = a['1.']; -var r3 = c[1.]; +var r3 = c[1.];// same as indexing by 1 when done numerically var r5 = a['1..']; var r6 = a['1.0']; -var r3 = c[1.0]; +var r3 = c[1.0];// same as indexing by 1 when done numerically // BUG 823822 var r7 = i[-1]; var r7 = i[-1.0]; @@ -208,10 +208,10 @@ var r2 = b['.1']; var r3 = b['1']; var r3 = c[1]; var r4 = b['1.']; -var r3 = c[1.]; +var r3 = c[1.];// same as indexing by 1 when done numerically var r5 = b['1..']; var r6 = b['1.0']; -var r3 = c[1.0]; +var r3 = c[1.0];// same as indexing by 1 when done numerically // BUG 823822 var r7 = i[-1]; var r7 = i[-1.0]; diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.js b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.js index 38d5491d080..25e3e33da8f 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.js +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignatures2.js @@ -93,7 +93,7 @@ var C = (function () { var a; var b = { new: function (x) { return ''; -} }; +} };// not a construct signature, function called new function foo1b(x) { } function foo1c(x) { diff --git a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.js b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.js index dcb2b66882c..968499ecbac 100644 --- a/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.js +++ b/tests/baselines/reference/objectTypesIdentityWithConstructSignaturesDifferingParamCounts.js @@ -93,7 +93,7 @@ var C = (function () { var a; var b = { new: function (x) { return ''; -} }; +} };// not a construct signature, function called new function foo1b(x) { } function foo1c(x) { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.js index ca2efb3ffb1..a3687db5a96 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints.js @@ -94,7 +94,7 @@ var C = (function () { var a; var b = { new: function (x) { return ''; -} }; +} };// not a construct signature, function called new function foo1b(x) { } function foo1c(x) { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.js index c3bc58b8654..cb0986b872f 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints2.js @@ -111,7 +111,7 @@ var D = (function () { var a; var b = { new: function (x, y) { return ''; -} }; +} };// not a construct signature, function called new function foo1b(x) { } function foo1c(x) { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.js index 292e65eb27d..619fcb8ed26 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByConstraints3.js @@ -130,7 +130,7 @@ var D = (function () { var a; var b = { new: function (x, y) { return ''; -} }; +} };// not a construct signature, function called new function foo1b(x) { } function foo1c(x) { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.js index bc8d77388ff..985d97bdd87 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType.js @@ -101,7 +101,7 @@ var C = (function () { var a; var b = { new: function (x) { return null; -} }; +} };// not a construct signature, function called new function foo1b(x) { } function foo1c(x) { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.js index 37d49a3be4b..6a29dbaced0 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesDifferingByReturnType2.js @@ -97,7 +97,7 @@ var C = (function () { var a; var b = { new: function (x) { return null; -} }; +} };// not a construct signature, function called new function foo1b(x) { } function foo1c(x) { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.js index 828f548d67c..2f80babc8d6 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams.js @@ -93,7 +93,7 @@ var C = (function () { var a; var b = { new: function (x, y) { return new C(x, y); -} }; +} };// not a construct signature, function called new function foo1b(x) { } function foo1c(x) { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.js index fbc020912db..94f459255f0 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams2.js @@ -93,7 +93,7 @@ var C = (function () { var a; var b = { new: function (x, y) { return new C(x, y); -} }; +} };// not a construct signature, function called new function foo1b(x) { } function foo1c(x) { diff --git a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.js b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.js index 0bb887d1c6c..6c509101af6 100644 --- a/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.js +++ b/tests/baselines/reference/objectTypesIdentityWithGenericConstructSignaturesOptionalParams3.js @@ -93,7 +93,7 @@ var C = (function () { var a; var b = { new: function (x, y) { return new C(x, y); -} }; +} };// not a construct signature, function called new function foo1b(x) { } function foo1c(x) { diff --git a/tests/baselines/reference/objectTypesWithPredefinedTypesAsName.js b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName.js index 6beb3471026..00205a33488 100644 --- a/tests/baselines/reference/objectTypesWithPredefinedTypesAsName.js +++ b/tests/baselines/reference/objectTypesWithPredefinedTypesAsName.js @@ -34,7 +34,7 @@ var bool = (function () { function bool() { } return bool; -})(); +})();// not a predefined type anymore var string = (function () { function string() { } diff --git a/tests/baselines/reference/optionalConstructorArgInSuper.js b/tests/baselines/reference/optionalConstructorArgInSuper.js index 1e88fd81299..c83db86fde1 100644 --- a/tests/baselines/reference/optionalConstructorArgInSuper.js +++ b/tests/baselines/reference/optionalConstructorArgInSuper.js @@ -31,6 +31,6 @@ var Derived = (function (_super) { } return Derived; })(Base); -var d = new Derived(); +var d = new Derived();// bug caused an error here, couldn't select overload var d2; d2.foo(); diff --git a/tests/baselines/reference/optionalParamAssignmentCompat.js b/tests/baselines/reference/optionalParamAssignmentCompat.js index a2b52677869..b4d7c238ca5 100644 --- a/tests/baselines/reference/optionalParamAssignmentCompat.js +++ b/tests/baselines/reference/optionalParamAssignmentCompat.js @@ -13,5 +13,5 @@ var d: I1 = i2.m1; // should error //// [optionalParamAssignmentCompat.js] var i2; -var c = i2.p1; -var d = i2.m1; +var c = i2.p1;// should be ok +var d = i2.m1;// should error diff --git a/tests/baselines/reference/overEagerReturnTypeSpecialization.js b/tests/baselines/reference/overEagerReturnTypeSpecialization.js index 4d921fb6b81..fbc199c6b45 100644 --- a/tests/baselines/reference/overEagerReturnTypeSpecialization.js +++ b/tests/baselines/reference/overEagerReturnTypeSpecialization.js @@ -15,5 +15,5 @@ var r2: I1 = v1.func(num => num.toString()) // Correctly returns an I1 number) => { } }; // error //// [overloadOnConstInObjectLiteralImplementingAnInterface.js] var i2 = { x1: function (a, cb) { -} }; +} };// error diff --git a/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.js b/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.js index bb082ac97fc..4664ccefee8 100644 --- a/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.js +++ b/tests/baselines/reference/overloadOnGenericClassAndNonGenericClass.js @@ -51,4 +51,4 @@ function f(a) { } var xs; var t3 = f(xs); -var t3; +var t3;// should not error diff --git a/tests/baselines/reference/overloadResolutionTest1.js b/tests/baselines/reference/overloadResolutionTest1.js index b24723d8210..021b2e9fee5 100644 --- a/tests/baselines/reference/overloadResolutionTest1.js +++ b/tests/baselines/reference/overloadResolutionTest1.js @@ -30,19 +30,19 @@ function foo(bar) { return bar; } ; -var x1 = foo([{ a: true }]); -var x11 = foo([{ a: 0 }]); -var x111 = foo([{ a: "s" }]); -var x1111 = foo([{ a: null }]); +var x1 = foo([{ a: true }]);// works +var x11 = foo([{ a: 0 }]);// works +var x111 = foo([{ a: "s" }]);// error - does not match any signature +var x1111 = foo([{ a: null }]);// works - ambiguous call is resolved to be the first in the overload set so this returns a string function foo2(bar) { return bar; } ; -var x2 = foo2({ a: 0 }); -var x3 = foo2({ a: true }); -var x4 = foo2({ a: "s" }); +var x2 = foo2({ a: 0 });// works +var x3 = foo2({ a: true });// works +var x4 = foo2({ a: "s" });// error function foo4(bar) { return bar; } ; -var x = foo4({ a: true }); +var x = foo4({ a: true });// error diff --git a/tests/baselines/reference/overloadingOnConstants2.js b/tests/baselines/reference/overloadingOnConstants2.js index 34094804f6a..990dbad5b7a 100644 --- a/tests/baselines/reference/overloadingOnConstants2.js +++ b/tests/baselines/reference/overloadingOnConstants2.js @@ -56,12 +56,12 @@ var E = (function () { function foo(x, items) { return null; } -var a = foo("hi", []); -var b = foo("bye", []); -var c = foo("um", []); +var a = foo("hi", []);// D +var b = foo("bye", []);// E +var c = foo("um", []);// error function bar(x, items) { return null; } -var d = bar("hi", []); -var e = bar("bye", []); -var f = bar("um", []); +var d = bar("hi", []);// D +var e = bar("bye", []);// E +var f = bar("um", []);// C diff --git a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js index b56693c97cd..2e34fca5ba8 100644 --- a/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js +++ b/tests/baselines/reference/overloadresolutionWithConstraintCheckingDeferred.js @@ -28,9 +28,9 @@ var G = (function () { } return G; })(); -var result = foo(function (x) { return new G(x); }); -var result2 = foo(function (x) { return new G(x); }); +var result = foo(function (x) { return new G(x); });// No error, returns number +var result2 = foo(function (x) { return new G(x); });// No error, returns number var result3 = foo(function (x) { - var y; + var y;// error that C does not satisfy constraint return y; }); diff --git a/tests/baselines/reference/overloadsWithinClasses.js b/tests/baselines/reference/overloadsWithinClasses.js index 8ef9341ec15..80806c6ca7a 100644 --- a/tests/baselines/reference/overloadsWithinClasses.js +++ b/tests/baselines/reference/overloadsWithinClasses.js @@ -30,14 +30,14 @@ var foo = (function () { foo.fnOverload = function () { }; foo.fnOverload = function (foo) { - }; + };// error return foo; })(); var bar = (function () { function bar() { } bar.fnOverload = function (foo) { - }; + };// no error return bar; })(); var X = (function () { diff --git a/tests/baselines/reference/paramPropertiesInSignatures.js b/tests/baselines/reference/paramPropertiesInSignatures.js index 03e73d143ae..8b0de90fd3d 100644 --- a/tests/baselines/reference/paramPropertiesInSignatures.js +++ b/tests/baselines/reference/paramPropertiesInSignatures.js @@ -15,6 +15,6 @@ declare class C2 { var C1 = (function () { function C1(p3) { this.p3 = p3; - } + }// OK return C1; })(); diff --git a/tests/baselines/reference/parserParameterList7.js b/tests/baselines/reference/parserParameterList7.js index f2ab0291817..bf048a0e3e3 100644 --- a/tests/baselines/reference/parserParameterList7.js +++ b/tests/baselines/reference/parserParameterList7.js @@ -9,6 +9,6 @@ class C1 { var C1 = (function () { function C1(p3) { this.p3 = p3; - } + }// OK return C1; })(); diff --git a/tests/baselines/reference/partiallyAmbientClodule.js b/tests/baselines/reference/partiallyAmbientClodule.js index d7182e73e09..1a09bbf3484 100644 --- a/tests/baselines/reference/partiallyAmbientClodule.js +++ b/tests/baselines/reference/partiallyAmbientClodule.js @@ -9,4 +9,4 @@ var foo = (function () { function foo() { } return foo; -})(); +})();// Legal, because module is ambient diff --git a/tests/baselines/reference/partiallyAmbientFundule.js b/tests/baselines/reference/partiallyAmbientFundule.js index e4712fbe730..6afdd00419e 100644 --- a/tests/baselines/reference/partiallyAmbientFundule.js +++ b/tests/baselines/reference/partiallyAmbientFundule.js @@ -6,4 +6,4 @@ function foo () { } // Legal, because module is ambient //// [partiallyAmbientFundule.js] function foo() { -} +}// Legal, because module is ambient diff --git a/tests/baselines/reference/primaryExpressionMods.js b/tests/baselines/reference/primaryExpressionMods.js index ced35861a2b..36797637f2b 100644 --- a/tests/baselines/reference/primaryExpressionMods.js +++ b/tests/baselines/reference/primaryExpressionMods.js @@ -17,9 +17,9 @@ var M; (function (M) { M.a = 1; })(M || (M = {})); -var p; -var m = M; -var m2 = M; -var x1 = M.a; -var x2 = m.a; -var q; +var p;// Used as ModuleName +var m = M;// Used as TypeName and PrimaryExpression (error on TypeName) +var m2 = M;// Used as PrimaryExpression in TypeQuery +var x1 = M.a;// Used as PrimaryExpression +var x2 = m.a;// Same as M.a +var q;// Error diff --git a/tests/baselines/reference/privacyCannotNameVarTypeDeclFile.js b/tests/baselines/reference/privacyCannotNameVarTypeDeclFile.js index 3a95daf0ede..7ddc6b36a14 100644 --- a/tests/baselines/reference/privacyCannotNameVarTypeDeclFile.js +++ b/tests/baselines/reference/privacyCannotNameVarTypeDeclFile.js @@ -151,14 +151,14 @@ exports.createExportedWidget4 = createExportedWidget4; var exporter = require("privacyCannotNameVarTypeDeclFile_exporter"); var publicClassWithWithPrivatePropertyTypes = (function () { function publicClassWithWithPrivatePropertyTypes() { - this.myPublicProperty = exporter.createExportedWidget1(); + this.myPublicProperty = exporter.createExportedWidget1();// Error this.myPrivateProperty = exporter.createExportedWidget1(); - this.myPublicProperty1 = exporter.createExportedWidget3(); + this.myPublicProperty1 = exporter.createExportedWidget3();// Error this.myPrivateProperty1 = exporter.createExportedWidget3(); } - publicClassWithWithPrivatePropertyTypes.myPublicStaticProperty = exporter.createExportedWidget1(); + publicClassWithWithPrivatePropertyTypes.myPublicStaticProperty = exporter.createExportedWidget1();// Error publicClassWithWithPrivatePropertyTypes.myPrivateStaticProperty = exporter.createExportedWidget1(); - publicClassWithWithPrivatePropertyTypes.myPublicStaticProperty1 = exporter.createExportedWidget3(); + publicClassWithWithPrivatePropertyTypes.myPublicStaticProperty1 = exporter.createExportedWidget3();// Error publicClassWithWithPrivatePropertyTypes.myPrivateStaticProperty1 = exporter.createExportedWidget3(); return publicClassWithWithPrivatePropertyTypes; })(); @@ -176,22 +176,22 @@ var privateClassWithWithPrivatePropertyTypes = (function () { privateClassWithWithPrivatePropertyTypes.myPrivateStaticProperty1 = exporter.createExportedWidget3(); return privateClassWithWithPrivatePropertyTypes; })(); -exports.publicVarWithPrivatePropertyTypes = exporter.createExportedWidget1(); +exports.publicVarWithPrivatePropertyTypes = exporter.createExportedWidget1();// Error var privateVarWithPrivatePropertyTypes = exporter.createExportedWidget1(); -exports.publicVarWithPrivatePropertyTypes1 = exporter.createExportedWidget3(); +exports.publicVarWithPrivatePropertyTypes1 = exporter.createExportedWidget3();// Error var privateVarWithPrivatePropertyTypes1 = exporter.createExportedWidget3(); var publicClassWithPrivateModulePropertyTypes = (function () { function publicClassWithPrivateModulePropertyTypes() { - this.myPublicProperty = exporter.createExportedWidget2(); - this.myPublicProperty1 = exporter.createExportedWidget4(); + this.myPublicProperty = exporter.createExportedWidget2();// Error + this.myPublicProperty1 = exporter.createExportedWidget4();// Error } - publicClassWithPrivateModulePropertyTypes.myPublicStaticProperty = exporter.createExportedWidget2(); - publicClassWithPrivateModulePropertyTypes.myPublicStaticProperty1 = exporter.createExportedWidget4(); + publicClassWithPrivateModulePropertyTypes.myPublicStaticProperty = exporter.createExportedWidget2();// Error + publicClassWithPrivateModulePropertyTypes.myPublicStaticProperty1 = exporter.createExportedWidget4();// Error return publicClassWithPrivateModulePropertyTypes; })(); exports.publicClassWithPrivateModulePropertyTypes = publicClassWithPrivateModulePropertyTypes; -exports.publicVarWithPrivateModulePropertyTypes = exporter.createExportedWidget2(); -exports.publicVarWithPrivateModulePropertyTypes1 = exporter.createExportedWidget4(); +exports.publicVarWithPrivateModulePropertyTypes = exporter.createExportedWidget2();// Error +exports.publicVarWithPrivateModulePropertyTypes1 = exporter.createExportedWidget4();// Error var privateClassWithPrivateModulePropertyTypes = (function () { function privateClassWithPrivateModulePropertyTypes() { this.myPublicProperty = exporter.createExportedWidget2(); diff --git a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.js b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.js index f2f2ac9ae12..75c4cd79e7d 100644 --- a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.js +++ b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter.js @@ -17,7 +17,7 @@ module Query { //// [privacyCheckAnonymousFunctionParameter.js] -exports.x = 1; +exports.x = 1;// Makes this an external module var Query; (function (Query) { function fromDoWhile(doWhile) { diff --git a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.js b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.js index a1897ac05a3..3492026895e 100644 --- a/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.js +++ b/tests/baselines/reference/privacyCheckAnonymousFunctionParameter2.js @@ -16,7 +16,7 @@ module Q { //// [privacyCheckAnonymousFunctionParameter2.js] define(["require", "exports"], function (require, exports) { - exports.x = 1; + exports.x = 1;// Makes this an external module var Q; (function (Q) { function foo(x) { diff --git a/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleNoError.js b/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleNoError.js index 4bf2ff55471..34764208f13 100644 --- a/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleNoError.js +++ b/tests/baselines/reference/privacyCheckTypeOfInvisibleModuleNoError.js @@ -15,5 +15,5 @@ var Outer; (function (Inner) { Inner.m; })(Inner || (Inner = {})); - Outer.f; + Outer.f;// Since we dont unwind inner any more, it is error here })(Outer || (Outer = {})); diff --git a/tests/baselines/reference/privacyGloVar.js b/tests/baselines/reference/privacyGloVar.js index f0a26119798..9f21e35947e 100644 --- a/tests/baselines/reference/privacyGloVar.js +++ b/tests/baselines/reference/privacyGloVar.js @@ -101,11 +101,11 @@ var m1; this.C3_v11_private = new C1_public(); this.C3_v12_public = new C1_public(); this.C3_v13_private = new C2_private(); - this.C3_v14_public = new C2_private(); + this.C3_v14_public = new C2_private();// error this.C3_v21_private = new C1_public(); this.C3_v22_public = new C1_public(); this.C3_v23_private = new C2_private(); - this.C3_v24_public = new C2_private(); + this.C3_v24_public = new C2_private();// error } return C3_public; })(); @@ -126,15 +126,15 @@ var m1; var m1_v1_private; m1.m1_v2_public; var m1_v3_private; - m1.m1_v4_public; + m1.m1_v4_public;// error var m1_v11_private = new C1_public(); m1.m1_v12_public = new C1_public(); var m1_v13_private = new C2_private(); - m1.m1_v14_public = new C2_private(); + m1.m1_v14_public = new C2_private();//error var m1_v21_private = new C1_public(); m1.m1_v22_public = new C1_public(); var m1_v23_private = new C2_private(); - m1.m1_v24_public = new C2_private(); + m1.m1_v24_public = new C2_private();// error })(m1 || (m1 = {})); var glo_C1_public = (function () { function glo_C1_public() { diff --git a/tests/baselines/reference/privacyVar.js b/tests/baselines/reference/privacyVar.js index d4528fb34eb..eb6d257bc41 100644 --- a/tests/baselines/reference/privacyVar.js +++ b/tests/baselines/reference/privacyVar.js @@ -194,11 +194,11 @@ export var glo_v24_public: glo_C2_private = new glo_C2_private(); // error this.C3_v11_private = new C1_public(); this.C3_v12_public = new C1_public(); this.C3_v13_private = new C2_private(); - this.C3_v14_public = new C2_private(); + this.C3_v14_public = new C2_private();// error this.C3_v21_private = new C1_public(); this.C3_v22_public = new C1_public(); this.C3_v23_private = new C2_private(); - this.C3_v24_public = new C2_private(); + this.C3_v24_public = new C2_private();// error } return C3_public; })(); @@ -219,15 +219,15 @@ export var glo_v24_public: glo_C2_private = new glo_C2_private(); // error var m1_v1_private; m1.m1_v2_public; var m1_v3_private; - m1.m1_v4_public; + m1.m1_v4_public;// error var m1_v11_private = new C1_public(); m1.m1_v12_public = new C1_public(); var m1_v13_private = new C2_private(); - m1.m1_v14_public = new C2_private(); + m1.m1_v14_public = new C2_private();//error var m1_v21_private = new C1_public(); m1.m1_v22_public = new C1_public(); var m1_v23_private = new C2_private(); - m1.m1_v24_public = new C2_private(); + m1.m1_v24_public = new C2_private();// error })(exports.m1 || (exports.m1 = {})); var m1 = exports.m1; var m2; @@ -303,11 +303,11 @@ var glo_C3_public = (function () { this.glo_C3_v11_private = new glo_C1_public(); this.glo_C3_v12_public = new glo_C1_public(); this.glo_C3_v13_private = new glo_C2_private(); - this.glo_C3_v14_public = new glo_C2_private(); + this.glo_C3_v14_public = new glo_C2_private();// error this.glo_C3_v21_private = new glo_C1_public(); this.glo_C3_v22_public = new glo_C1_public(); this.glo_C3_v23_private = new glo_C2_private(); - this.glo_C3_v24_public = new glo_C2_private(); + this.glo_C3_v24_public = new glo_C2_private();//error } return glo_C3_public; })(); @@ -328,12 +328,12 @@ var glo_C4_public = (function () { var glo_v1_private; exports.glo_v2_public; var glo_v3_private; -exports.glo_v4_public; +exports.glo_v4_public;// error var glo_v11_private = new glo_C1_public(); exports.glo_v12_public = new glo_C1_public(); var glo_v13_private = new glo_C2_private(); -exports.glo_v14_public = new glo_C2_private(); +exports.glo_v14_public = new glo_C2_private();// error var glo_v21_private = new glo_C1_public(); exports.glo_v22_public = new glo_C1_public(); var glo_v23_private = new glo_C2_private(); -exports.glo_v24_public = new glo_C2_private(); +exports.glo_v24_public = new glo_C2_private();// error diff --git a/tests/baselines/reference/privacyVarDeclFile.js b/tests/baselines/reference/privacyVarDeclFile.js index 922c056b3a7..2ad4d0b8c35 100644 --- a/tests/baselines/reference/privacyVarDeclFile.js +++ b/tests/baselines/reference/privacyVarDeclFile.js @@ -459,7 +459,7 @@ var privateClassWithWithPublicPropertyTypes = (function () { } return privateClassWithWithPublicPropertyTypes; })(); -exports.publicVarWithPrivatePropertyTypes; +exports.publicVarWithPrivatePropertyTypes;// Error exports.publicVarWithPublicPropertyTypes; var privateVarWithPrivatePropertyTypes; var privateVarWithPublicPropertyTypes; @@ -469,7 +469,7 @@ var publicClassWithPrivateModulePropertyTypes = (function () { return publicClassWithPrivateModulePropertyTypes; })(); exports.publicClassWithPrivateModulePropertyTypes = publicClassWithPrivateModulePropertyTypes; -exports.publicVarWithPrivateModulePropertyTypes; +exports.publicVarWithPrivateModulePropertyTypes;// Error var privateClassWithPrivateModulePropertyTypes = (function () { function privateClassWithPrivateModulePropertyTypes() { } @@ -510,7 +510,7 @@ var privateVarWithPrivateModulePropertyTypes; } return privateClassWithWithPublicPropertyTypes; })(); - publicModule.publicVarWithPrivatePropertyTypes; + publicModule.publicVarWithPrivatePropertyTypes;// Error publicModule.publicVarWithPublicPropertyTypes; var privateVarWithPrivatePropertyTypes; var privateVarWithPublicPropertyTypes; @@ -520,7 +520,7 @@ var privateVarWithPrivateModulePropertyTypes; return publicClassWithPrivateModulePropertyTypes; })(); publicModule.publicClassWithPrivateModulePropertyTypes = publicClassWithPrivateModulePropertyTypes; - publicModule.publicVarWithPrivateModulePropertyTypes; + publicModule.publicVarWithPrivateModulePropertyTypes;// Error var privateClassWithPrivateModulePropertyTypes = (function () { function privateClassWithPrivateModulePropertyTypes() { } @@ -682,7 +682,7 @@ var publicModuleInGlobal; } return privateClassWithWithPublicPropertyTypes; })(); - publicModuleInGlobal.publicVarWithPrivatePropertyTypes; + publicModuleInGlobal.publicVarWithPrivatePropertyTypes;// Error publicModuleInGlobal.publicVarWithPublicPropertyTypes; var privateVarWithPrivatePropertyTypes; var privateVarWithPublicPropertyTypes; @@ -692,7 +692,7 @@ var publicModuleInGlobal; return publicClassWithPrivateModulePropertyTypes; })(); publicModuleInGlobal.publicClassWithPrivateModulePropertyTypes = publicClassWithPrivateModulePropertyTypes; - publicModuleInGlobal.publicVarWithPrivateModulePropertyTypes; + publicModuleInGlobal.publicVarWithPrivateModulePropertyTypes;// Error var privateClassWithPrivateModulePropertyTypes = (function () { function privateClassWithPrivateModulePropertyTypes() { } diff --git a/tests/baselines/reference/privateStaticMemberAccessibility.js b/tests/baselines/reference/privateStaticMemberAccessibility.js index b948139ecad..7aed14aa0cf 100644 --- a/tests/baselines/reference/privateStaticMemberAccessibility.js +++ b/tests/baselines/reference/privateStaticMemberAccessibility.js @@ -24,8 +24,8 @@ var Derived = (function (_super) { __extends(Derived, _super); function Derived() { _super.apply(this, arguments); - this.bing = function () { return Base.foo; }; + this.bing = function () { return Base.foo; };// error } - Derived.bar = Base.foo; + Derived.bar = Base.foo;// error return Derived; })(Base); diff --git a/tests/baselines/reference/privateStaticNotAccessibleInClodule.js b/tests/baselines/reference/privateStaticNotAccessibleInClodule.js index a0b930db4d9..1a213caf8f2 100644 --- a/tests/baselines/reference/privateStaticNotAccessibleInClodule.js +++ b/tests/baselines/reference/privateStaticNotAccessibleInClodule.js @@ -19,5 +19,5 @@ var C = (function () { })(); var C; (function (C) { - C.y = C.bar; + C.y = C.bar;// error })(C || (C = {})); diff --git a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js index 473a71663a7..bd5af72719f 100644 --- a/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js +++ b/tests/baselines/reference/privateStaticNotAccessibleInClodule2.js @@ -36,5 +36,5 @@ var D = (function (_super) { })(C); var D; (function (D) { - D.y = D.bar; + D.y = D.bar;// error })(D || (D = {})); diff --git a/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/m5.js b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/m5.js index b9856df80d0..daa4208d91e 100644 --- a/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/m5.js +++ b/tests/baselines/reference/project/declarationsIndirectImportShouldResultInError/node/m5.js @@ -1,4 +1,4 @@ -var m4 = require("m4"); +var m4 = require("m4");// Emit used function foo2() { return new m4.d(); } diff --git a/tests/baselines/reference/project/declarationsMultipleTimesImport/node/useModule.js b/tests/baselines/reference/project/declarationsMultipleTimesImport/node/useModule.js index 2de3f23432a..3e4df4b7af0 100644 --- a/tests/baselines/reference/project/declarationsMultipleTimesImport/node/useModule.js +++ b/tests/baselines/reference/project/declarationsMultipleTimesImport/node/useModule.js @@ -1,4 +1,4 @@ -var m4 = require("m4"); +var m4 = require("m4");// Emit used exports.x4 = m4.x; exports.d4 = m4.d; exports.f4 = m4.foo(); @@ -12,7 +12,7 @@ exports.f4 = m4.foo(); })(exports.m1 || (exports.m1 = {})); var m1 = exports.m1; // Do not emit multiple used import statements -var multiImport_m4 = require("m4"); +var multiImport_m4 = require("m4");// Emit used exports.useMultiImport_m4_x4 = multiImport_m4.x; exports.useMultiImport_m4_d4 = multiImport_m4.d; exports.useMultiImport_m4_f4 = multiImport_m4.foo(); diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m5.js b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m5.js index b9856df80d0..daa4208d91e 100644 --- a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m5.js +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/m5.js @@ -1,4 +1,4 @@ -var m4 = require("m4"); +var m4 = require("m4");// Emit used function foo2() { return new m4.d(); } diff --git a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/useModule.js b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/useModule.js index 80a5c980876..42990a15a45 100644 --- a/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/useModule.js +++ b/tests/baselines/reference/project/declarationsMultipleTimesMultipleImport/node/useModule.js @@ -1,4 +1,4 @@ -var m4 = require("m4"); +var m4 = require("m4");// Emit used exports.x4 = m4.x; exports.d4 = m4.d; exports.f4 = m4.foo(); diff --git a/tests/baselines/reference/project/declarationsSimpleImport/node/useModule.js b/tests/baselines/reference/project/declarationsSimpleImport/node/useModule.js index 23d0d8c66d5..bbd30f8178f 100644 --- a/tests/baselines/reference/project/declarationsSimpleImport/node/useModule.js +++ b/tests/baselines/reference/project/declarationsSimpleImport/node/useModule.js @@ -1,4 +1,4 @@ -var m4 = require("m4"); +var m4 = require("m4");// Emit used exports.x4 = m4.x; exports.d4 = m4.d; exports.f4 = m4.foo(); diff --git a/tests/baselines/reference/promiseChaining.js b/tests/baselines/reference/promiseChaining.js index c914937bd6c..0b27786529e 100644 --- a/tests/baselines/reference/promiseChaining.js +++ b/tests/baselines/reference/promiseChaining.js @@ -19,7 +19,7 @@ var Chain = (function () { Chain.prototype.then = function (cb) { var result = cb(this.value); // should get a fresh type parameter which each then call - var z = this.then(function (x) { return result; }).then(function (x) { return "abc"; }).then(function (x) { return x.length; }); + var z = this.then(function (x) { return result; }).then(function (x) { return "abc"; }).then(function (x) { return x.length; })/*number*/ ;// No error return new Chain(result); }; return Chain; diff --git a/tests/baselines/reference/promiseChaining1.js b/tests/baselines/reference/promiseChaining1.js index a3633ba493f..827a4501349 100644 --- a/tests/baselines/reference/promiseChaining1.js +++ b/tests/baselines/reference/promiseChaining1.js @@ -19,7 +19,7 @@ var Chain2 = (function () { Chain2.prototype.then = function (cb) { var result = cb(this.value); // should get a fresh type parameter which each then call - var z = this.then(function (x) { return result; }).then(function (x) { return "abc"; }).then(function (x) { return x.length; }); + var z = this.then(function (x) { return result; }).then(function (x) { return "abc"; }).then(function (x) { return x.length; })/*number*/ ;// Should error on "abc" because it is not a Function return new Chain2(result); }; return Chain2; diff --git a/tests/baselines/reference/promisePermutations.js b/tests/baselines/reference/promisePermutations.js index c143e20bde3..9a9f38a76ff 100644 --- a/tests/baselines/reference/promisePermutations.js +++ b/tests/baselines/reference/promisePermutations.js @@ -196,84 +196,84 @@ var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunctio var r4; var sIPromise; var sPromise; -var r4a = r4.then(testFunction4, testFunction4, testFunction4); -var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); +var r4a = r4.then(testFunction4, testFunction4, testFunction4);// error +var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4);// ok var s4; -var s4a = s4.then(testFunction4, testFunction4, testFunction4); -var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); -var s4c = s4.then(testFunction4P, testFunction4, testFunction4); +var s4a = s4.then(testFunction4, testFunction4, testFunction4);// error +var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P);// error +var s4c = s4.then(testFunction4P, testFunction4, testFunction4);// error var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5; -var r5a = r5.then(testFunction5, testFunction5, testFunction5); -var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var r5a = r5.then(testFunction5, testFunction5, testFunction5);// error +var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise);// ok var s5; -var s5a = s5.then(testFunction5, testFunction5, testFunction5); -var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); -var s5c = s5.then(testFunction5P, testFunction5, testFunction5); -var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); +var s5a = s5.then(testFunction5, testFunction5, testFunction5);// error +var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P);// error +var s5c = s5.then(testFunction5P, testFunction5, testFunction5);// error +var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise);// ok var r6; -var r6a = r6.then(testFunction6, testFunction6, testFunction6); -var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var r6a = r6.then(testFunction6, testFunction6, testFunction6);// error +var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise);// ok var s6; -var s6a = s6.then(testFunction6, testFunction6, testFunction6); -var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); -var s6c = s6.then(testFunction6P, testFunction6, testFunction6); -var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); +var s6a = s6.then(testFunction6, testFunction6, testFunction6);// error +var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P);// error +var s6c = s6.then(testFunction6P, testFunction6, testFunction6);// error +var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise);// ok var r7; -var r7a = r7.then(testFunction7, testFunction7, testFunction7); -var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var r7a = r7.then(testFunction7, testFunction7, testFunction7);// error +var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise);// ok var s7; -var s7a = r7.then(testFunction7, testFunction7, testFunction7); -var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); -var s7c = r7.then(testFunction7P, testFunction7, testFunction7); -var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); +var s7a = r7.then(testFunction7, testFunction7, testFunction7);// error +var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P);// error +var s7c = r7.then(testFunction7P, testFunction7, testFunction7);// error +var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise);// ok? var r8; var nIPromise; var nPromise; -var r8a = r8.then(testFunction8, testFunction8, testFunction8); -var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); +var r8a = r8.then(testFunction8, testFunction8, testFunction8);// error +var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise);// ok var s8; -var s8a = s8.then(testFunction8, testFunction8, testFunction8); -var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); -var s8c = s8.then(testFunction8P, testFunction8, testFunction8); -var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); +var s8a = s8.then(testFunction8, testFunction8, testFunction8);// error +var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P);// error +var s8c = s8.then(testFunction8P, testFunction8, testFunction8);// error +var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise);// ok var r9; -var r9a = r9.then(testFunction9, testFunction9, testFunction9); -var r9b = r9.then(sIPromise, sIPromise, sIPromise); -var r9c = r9.then(nIPromise, nIPromise, nIPromise); -var r9d = r9.then(testFunction, sIPromise, nIPromise); -var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var r9a = r9.then(testFunction9, testFunction9, testFunction9);// error +var r9b = r9.then(sIPromise, sIPromise, sIPromise);// ok +var r9c = r9.then(nIPromise, nIPromise, nIPromise);// ok +var r9d = r9.then(testFunction, sIPromise, nIPromise);// ok +var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise);// ok var s9; -var s9a = s9.then(testFunction9, testFunction9, testFunction9); -var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); -var s9c = s9.then(testFunction9P, testFunction9, testFunction9); -var s9d = s9.then(sPromise, sPromise, sPromise); -var s9e = s9.then(nPromise, nPromise, nPromise); -var s9f = s9.then(testFunction, sIPromise, nIPromise); -var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var s9a = s9.then(testFunction9, testFunction9, testFunction9);// error +var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P);// error +var s9c = s9.then(testFunction9P, testFunction9, testFunction9);// error +var s9d = s9.then(sPromise, sPromise, sPromise);// ok +var s9e = s9.then(nPromise, nPromise, nPromise);// ok +var s9f = s9.then(testFunction, sIPromise, nIPromise);// ok +var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise);// ok var r10 = testFunction10(function (x) { return x; }); -var r10a = r10.then(testFunction10, testFunction10, testFunction10); -var r10b = r10.then(sIPromise, sIPromise, sIPromise); -var r10c = r10.then(nIPromise, nIPromise, nIPromise); -var r10d = r10.then(testFunction, sIPromise, nIPromise); -var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var r10a = r10.then(testFunction10, testFunction10, testFunction10);// ok +var r10b = r10.then(sIPromise, sIPromise, sIPromise);// ok +var r10c = r10.then(nIPromise, nIPromise, nIPromise);// ok +var r10d = r10.then(testFunction, sIPromise, nIPromise);// ok +var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise);// ok var s10 = testFunction10P(function (x) { return x; }); -var s10a = s10.then(testFunction10, testFunction10, testFunction10); -var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); -var s10c = s10.then(testFunction10P, testFunction10, testFunction10); -var s10d = s10.then(sPromise, sPromise, sPromise); -var s10e = s10.then(nIPromise, nPromise, nIPromise); -var s10f = s10.then(testFunctionP, sIPromise, nIPromise); -var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); +var s10a = s10.then(testFunction10, testFunction10, testFunction10);// ok +var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P);// ok +var s10c = s10.then(testFunction10P, testFunction10, testFunction10);// ok +var s10d = s10.then(sPromise, sPromise, sPromise);// ok +var s10e = s10.then(nIPromise, nPromise, nIPromise);// ok +var s10f = s10.then(testFunctionP, sIPromise, nIPromise);// ok +var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise);// ok var r11; -var r11a = r11.then(testFunction11, testFunction11, testFunction11); +var r11a = r11.then(testFunction11, testFunction11, testFunction11);// ok var s11; -var s11a = s11.then(testFunction11, testFunction11, testFunction11); -var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); -var s11c = s11.then(testFunction11P, testFunction11, testFunction11); +var s11a = s11.then(testFunction11, testFunction11, testFunction11);// ok +var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P);// ok +var s11c = s11.then(testFunction11P, testFunction11, testFunction11);// ok var r12 = testFunction12(function (x) { return x; }); -var r12a = r12.then(testFunction12, testFunction12, testFunction12); +var r12a = r12.then(testFunction12, testFunction12, testFunction12);// ok var s12 = testFunction12(function (x) { return x; }); -var s12a = s12.then(testFunction12, testFunction12, testFunction12); -var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); -var s12c = s12.then(testFunction12P, testFunction12, testFunction12); +var s12a = s12.then(testFunction12, testFunction12, testFunction12);// ok +var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P);// ok +var s12c = s12.then(testFunction12P, testFunction12, testFunction12);// ok diff --git a/tests/baselines/reference/promisePermutations2.js b/tests/baselines/reference/promisePermutations2.js index 12f90880bc7..d9b1395036a 100644 --- a/tests/baselines/reference/promisePermutations2.js +++ b/tests/baselines/reference/promisePermutations2.js @@ -191,88 +191,88 @@ var s3; var s3a = s3.then(testFunction3, testFunction3, testFunction3); var s3b = s3.then(testFunction3P, testFunction3P, testFunction3P); var s3c = s3.then(testFunction3P, testFunction3, testFunction3); -var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3); +var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunction3, testFunction3, testFunction3);// Should error var r4; var sIPromise; var sPromise; -var r4a = r4.then(testFunction4, testFunction4, testFunction4); -var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); +var r4a = r4.then(testFunction4, testFunction4, testFunction4);// error +var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4);// ok var s4; -var s4a = s4.then(testFunction4, testFunction4, testFunction4); -var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); -var s4c = s4.then(testFunction4P, testFunction4, testFunction4); +var s4a = s4.then(testFunction4, testFunction4, testFunction4);// error +var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P);// error +var s4c = s4.then(testFunction4P, testFunction4, testFunction4);// error var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5; -var r5a = r5.then(testFunction5, testFunction5, testFunction5); -var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var r5a = r5.then(testFunction5, testFunction5, testFunction5);// error +var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise);// ok var s5; -var s5a = s5.then(testFunction5, testFunction5, testFunction5); -var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); -var s5c = s5.then(testFunction5P, testFunction5, testFunction5); -var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); +var s5a = s5.then(testFunction5, testFunction5, testFunction5);// error +var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P);// error +var s5c = s5.then(testFunction5P, testFunction5, testFunction5);// error +var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise);// ok var r6; -var r6a = r6.then(testFunction6, testFunction6, testFunction6); -var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var r6a = r6.then(testFunction6, testFunction6, testFunction6);// error +var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise);// ok var s6; -var s6a = s6.then(testFunction6, testFunction6, testFunction6); -var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); -var s6c = s6.then(testFunction6P, testFunction6, testFunction6); -var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); +var s6a = s6.then(testFunction6, testFunction6, testFunction6);// error +var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P);// error +var s6c = s6.then(testFunction6P, testFunction6, testFunction6);// error +var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise);// ok var r7; -var r7a = r7.then(testFunction7, testFunction7, testFunction7); -var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var r7a = r7.then(testFunction7, testFunction7, testFunction7);// error +var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise);// ok var s7; -var s7a = r7.then(testFunction7, testFunction7, testFunction7); -var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); -var s7c = r7.then(testFunction7P, testFunction7, testFunction7); -var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); +var s7a = r7.then(testFunction7, testFunction7, testFunction7);// error +var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P);// error +var s7c = r7.then(testFunction7P, testFunction7, testFunction7);// error +var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise);// ok? var r8; var nIPromise; var nPromise; -var r8a = r8.then(testFunction8, testFunction8, testFunction8); -var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); +var r8a = r8.then(testFunction8, testFunction8, testFunction8);// error +var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise);// ok var s8; -var s8a = s8.then(testFunction8, testFunction8, testFunction8); -var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); -var s8c = s8.then(testFunction8P, testFunction8, testFunction8); -var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); +var s8a = s8.then(testFunction8, testFunction8, testFunction8);// error +var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P);// error +var s8c = s8.then(testFunction8P, testFunction8, testFunction8);// error +var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise);// ok var r9; -var r9a = r9.then(testFunction9, testFunction9, testFunction9); -var r9b = r9.then(sIPromise, sIPromise, sIPromise); -var r9c = r9.then(nIPromise, nIPromise, nIPromise); -var r9d = r9.then(testFunction, sIPromise, nIPromise); -var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var r9a = r9.then(testFunction9, testFunction9, testFunction9);// error +var r9b = r9.then(sIPromise, sIPromise, sIPromise);// ok +var r9c = r9.then(nIPromise, nIPromise, nIPromise);// ok +var r9d = r9.then(testFunction, sIPromise, nIPromise);// ok +var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise);// ok var s9; -var s9a = s9.then(testFunction9, testFunction9, testFunction9); -var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); -var s9c = s9.then(testFunction9P, testFunction9, testFunction9); -var s9d = s9.then(sPromise, sPromise, sPromise); -var s9e = s9.then(nPromise, nPromise, nPromise); -var s9f = s9.then(testFunction, sIPromise, nIPromise); -var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var s9a = s9.then(testFunction9, testFunction9, testFunction9);// error +var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P);// error +var s9c = s9.then(testFunction9P, testFunction9, testFunction9);// error +var s9d = s9.then(sPromise, sPromise, sPromise);// ok +var s9e = s9.then(nPromise, nPromise, nPromise);// ok +var s9f = s9.then(testFunction, sIPromise, nIPromise);// ok +var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise);// ok var r10 = testFunction10(function (x) { return x; }); -var r10a = r10.then(testFunction10, testFunction10, testFunction10); -var r10b = r10.then(sIPromise, sIPromise, sIPromise); -var r10c = r10.then(nIPromise, nIPromise, nIPromise); -var r10d = r10.then(testFunction, sIPromise, nIPromise); -var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var r10a = r10.then(testFunction10, testFunction10, testFunction10);// ok +var r10b = r10.then(sIPromise, sIPromise, sIPromise);// ok +var r10c = r10.then(nIPromise, nIPromise, nIPromise);// ok +var r10d = r10.then(testFunction, sIPromise, nIPromise);// ok +var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise);// ok var s10 = testFunction10P(function (x) { return x; }); -var s10a = s10.then(testFunction10, testFunction10, testFunction10); -var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); -var s10c = s10.then(testFunction10P, testFunction10, testFunction10); -var s10d = s10.then(sPromise, sPromise, sPromise); -var s10e = s10.then(nIPromise, nPromise, nIPromise); -var s10f = s10.then(testFunctionP, sIPromise, nIPromise); -var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); +var s10a = s10.then(testFunction10, testFunction10, testFunction10);// ok +var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P);// ok +var s10c = s10.then(testFunction10P, testFunction10, testFunction10);// ok +var s10d = s10.then(sPromise, sPromise, sPromise);// ok +var s10e = s10.then(nIPromise, nPromise, nIPromise);// ok +var s10f = s10.then(testFunctionP, sIPromise, nIPromise);// ok +var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise);// ok var r11; -var r11a = r11.then(testFunction11, testFunction11, testFunction11); +var r11a = r11.then(testFunction11, testFunction11, testFunction11);// ok var s11; -var s11a = s11.then(testFunction11, testFunction11, testFunction11); -var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); -var s11c = s11.then(testFunction11P, testFunction11, testFunction11); +var s11a = s11.then(testFunction11, testFunction11, testFunction11);// ok +var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P);// ok +var s11c = s11.then(testFunction11P, testFunction11, testFunction11);// ok var r12 = testFunction12(function (x) { return x; }); -var r12a = r12.then(testFunction12, testFunction12, testFunction12); +var r12a = r12.then(testFunction12, testFunction12, testFunction12);// ok var s12 = testFunction12(function (x) { return x; }); -var s12a = s12.then(testFunction12, testFunction12, testFunction12); -var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); -var s12c = s12.then(testFunction12P, testFunction12, testFunction12); +var s12a = s12.then(testFunction12, testFunction12, testFunction12);// ok +var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P);// ok +var s12c = s12.then(testFunction12P, testFunction12, testFunction12);// ok diff --git a/tests/baselines/reference/promisePermutations3.js b/tests/baselines/reference/promisePermutations3.js index a5aaf917020..83138bc875d 100644 --- a/tests/baselines/reference/promisePermutations3.js +++ b/tests/baselines/reference/promisePermutations3.js @@ -195,84 +195,84 @@ var s3d = s3.then(testFunction3P, testFunction3, testFunction3).then(testFunctio var r4; var sIPromise; var sPromise; -var r4a = r4.then(testFunction4, testFunction4, testFunction4); -var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4); +var r4a = r4.then(testFunction4, testFunction4, testFunction4);// error +var r4b = r4.then(sIPromise, testFunction4, testFunction4).then(sIPromise, testFunction4, testFunction4);// ok var s4; -var s4a = s4.then(testFunction4, testFunction4, testFunction4); -var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P); -var s4c = s4.then(testFunction4P, testFunction4, testFunction4); +var s4a = s4.then(testFunction4, testFunction4, testFunction4);// error +var s4b = s4.then(testFunction4P, testFunction4P, testFunction4P);// error +var s4c = s4.then(testFunction4P, testFunction4, testFunction4);// error var s4d = s4.then(sIPromise, testFunction4P, testFunction4).then(sIPromise, testFunction4P, testFunction4); var r5; -var r5a = r5.then(testFunction5, testFunction5, testFunction5); -var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var r5a = r5.then(testFunction5, testFunction5, testFunction5);// error +var r5b = r5.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise);// ok var s5; -var s5a = s5.then(testFunction5, testFunction5, testFunction5); -var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P); -var s5c = s5.then(testFunction5P, testFunction5, testFunction5); -var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); +var s5a = s5.then(testFunction5, testFunction5, testFunction5);// error +var s5b = s5.then(testFunction5P, testFunction5P, testFunction5P);// error +var s5c = s5.then(testFunction5P, testFunction5, testFunction5);// error +var s5d = s5.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise);// ok var r6; -var r6a = r6.then(testFunction6, testFunction6, testFunction6); -var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var r6a = r6.then(testFunction6, testFunction6, testFunction6);// error +var r6b = r6.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise);// ok var s6; -var s6a = s6.then(testFunction6, testFunction6, testFunction6); -var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P); -var s6c = s6.then(testFunction6P, testFunction6, testFunction6); -var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise); +var s6a = s6.then(testFunction6, testFunction6, testFunction6);// error +var s6b = s6.then(testFunction6P, testFunction6P, testFunction6P);// error +var s6c = s6.then(testFunction6P, testFunction6, testFunction6);// error +var s6d = s6.then(sPromise, sPromise, sPromise).then(sIPromise, sIPromise, sIPromise);// ok var r7; -var r7a = r7.then(testFunction7, testFunction7, testFunction7); -var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var r7a = r7.then(testFunction7, testFunction7, testFunction7);// error +var r7b = r7.then(sIPromise, sIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise);// ok var s7; -var s7a = r7.then(testFunction7, testFunction7, testFunction7); -var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P); -var s7c = r7.then(testFunction7P, testFunction7, testFunction7); -var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise); +var s7a = r7.then(testFunction7, testFunction7, testFunction7);// error +var s7b = r7.then(testFunction7P, testFunction7P, testFunction7P);// error +var s7c = r7.then(testFunction7P, testFunction7, testFunction7);// error +var s7d = r7.then(sPromise, sPromise, sPromise).then(sPromise, sPromise, sPromise);// ok? var r8; var nIPromise; var nPromise; -var r8a = r8.then(testFunction8, testFunction8, testFunction8); -var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); +var r8a = r8.then(testFunction8, testFunction8, testFunction8);// error +var r8b = r8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise);// ok var s8; -var s8a = s8.then(testFunction8, testFunction8, testFunction8); -var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P); -var s8c = s8.then(testFunction8P, testFunction8, testFunction8); -var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise); +var s8a = s8.then(testFunction8, testFunction8, testFunction8);// error +var s8b = s8.then(testFunction8P, testFunction8P, testFunction8P);// error +var s8c = s8.then(testFunction8P, testFunction8, testFunction8);// error +var s8d = s8.then(nIPromise, nIPromise, nIPromise).then(nIPromise, nIPromise, nIPromise);// ok var r9; -var r9a = r9.then(testFunction9, testFunction9, testFunction9); -var r9b = r9.then(sIPromise, sIPromise, sIPromise); -var r9c = r9.then(nIPromise, nIPromise, nIPromise); -var r9d = r9.then(testFunction, sIPromise, nIPromise); -var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var r9a = r9.then(testFunction9, testFunction9, testFunction9);// error +var r9b = r9.then(sIPromise, sIPromise, sIPromise);// ok +var r9c = r9.then(nIPromise, nIPromise, nIPromise);// ok +var r9d = r9.then(testFunction, sIPromise, nIPromise);// ok +var r9e = r9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise);// ok var s9; -var s9a = s9.then(testFunction9, testFunction9, testFunction9); -var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P); -var s9c = s9.then(testFunction9P, testFunction9, testFunction9); -var s9d = s9.then(sPromise, sPromise, sPromise); -var s9e = s9.then(nPromise, nPromise, nPromise); -var s9f = s9.then(testFunction, sIPromise, nIPromise); -var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var s9a = s9.then(testFunction9, testFunction9, testFunction9);// error +var s9b = s9.then(testFunction9P, testFunction9P, testFunction9P);// error +var s9c = s9.then(testFunction9P, testFunction9, testFunction9);// error +var s9d = s9.then(sPromise, sPromise, sPromise);// ok +var s9e = s9.then(nPromise, nPromise, nPromise);// ok +var s9f = s9.then(testFunction, sIPromise, nIPromise);// ok +var s9g = s9.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise);// ok var r10 = testFunction10(function (x) { return x; }); -var r10a = r10.then(testFunction10, testFunction10, testFunction10); -var r10b = r10.then(sIPromise, sIPromise, sIPromise); -var r10c = r10.then(nIPromise, nIPromise, nIPromise); -var r10d = r10.then(testFunction, sIPromise, nIPromise); -var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise); +var r10a = r10.then(testFunction10, testFunction10, testFunction10);// ok +var r10b = r10.then(sIPromise, sIPromise, sIPromise);// ok +var r10c = r10.then(nIPromise, nIPromise, nIPromise);// ok +var r10d = r10.then(testFunction, sIPromise, nIPromise);// ok +var r10e = r10.then(testFunction, nIPromise, sIPromise).then(sIPromise, sIPromise, sIPromise);// ok var s10 = testFunction10P(function (x) { return x; }); -var s10a = s10.then(testFunction10, testFunction10, testFunction10); -var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P); -var s10c = s10.then(testFunction10P, testFunction10, testFunction10); -var s10d = s10.then(sPromise, sPromise, sPromise); -var s10e = s10.then(nIPromise, nPromise, nIPromise); -var s10f = s10.then(testFunctionP, sIPromise, nIPromise); -var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise); +var s10a = s10.then(testFunction10, testFunction10, testFunction10);// ok +var s10b = s10.then(testFunction10P, testFunction10P, testFunction10P);// ok +var s10c = s10.then(testFunction10P, testFunction10, testFunction10);// ok +var s10d = s10.then(sPromise, sPromise, sPromise);// ok +var s10e = s10.then(nIPromise, nPromise, nIPromise);// ok +var s10f = s10.then(testFunctionP, sIPromise, nIPromise);// ok +var s10g = s10.then(testFunctionP, nIPromise, sIPromise).then(sPromise, sIPromise, sIPromise);// ok var r11; -var r11a = r11.then(testFunction11, testFunction11, testFunction11); +var r11a = r11.then(testFunction11, testFunction11, testFunction11);// ok var s11; -var s11a = s11.then(testFunction11, testFunction11, testFunction11); -var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P); -var s11c = s11.then(testFunction11P, testFunction11, testFunction11); +var s11a = s11.then(testFunction11, testFunction11, testFunction11);// ok +var s11b = s11.then(testFunction11P, testFunction11P, testFunction11P);// ok +var s11c = s11.then(testFunction11P, testFunction11, testFunction11);// ok var r12 = testFunction12(function (x) { return x; }); -var r12a = r12.then(testFunction12, testFunction12, testFunction12); +var r12a = r12.then(testFunction12, testFunction12, testFunction12);// ok var s12 = testFunction12(function (x) { return x; }); -var s12a = s12.then(testFunction12, testFunction12, testFunction12); -var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P); -var s12c = s12.then(testFunction12P, testFunction12, testFunction12); +var s12a = s12.then(testFunction12, testFunction12, testFunction12);// ok +var s12b = s12.then(testFunction12P, testFunction12P, testFunction12P);// ok +var s12c = s12.then(testFunction12P, testFunction12, testFunction12);// ok diff --git a/tests/baselines/reference/promiseTest.js b/tests/baselines/reference/promiseTest.js index 0893770e0ce..0e64ff72478 100644 --- a/tests/baselines/reference/promiseTest.js +++ b/tests/baselines/reference/promiseTest.js @@ -20,4 +20,4 @@ var p = null; var p2 = p.then(function (x) { return p; }); -var x = p2.data; +var x = p2.data;// number diff --git a/tests/baselines/reference/propertyAccess.js b/tests/baselines/reference/propertyAccess.js index e4682316baf..43baafbb1f6 100644 --- a/tests/baselines/reference/propertyAccess.js +++ b/tests/baselines/reference/propertyAccess.js @@ -160,7 +160,7 @@ var aa = obj.x; // Dotted property access of property that exists on value's apparent type var bb = obj.hasOwnProperty; // Dotted property access of property that doesn't exist on value's apparent type -var cc = obj.qqq; +var cc = obj.qqq;// error // Bracket notation property access using string literal value on type with property of that literal name var dd = obj['literal property']; var dd; @@ -186,7 +186,7 @@ var jj; var kk = numIndex['what']; var kk; // Bracket notation property access using value of other type on type with numeric index signature and no string index signature -var ll = numIndex[window]; +var ll = numIndex[window];// Error // Bracket notation property access using string value on type with string index signature and no numeric index signature var mm = strIndex['N']; var mm; @@ -214,7 +214,7 @@ var ss; var tt = noIndex[null]; var tt; // Bracket notation property access using values of other types on type with no index signatures -var uu = noIndex[window]; +var uu = noIndex[window];// Error // Bracket notation property access using numeric value on type with numeric index signature and string index signature var vv = noIndex[32]; var vv; @@ -231,4 +231,4 @@ var yy; var zz = bothIndex['1.0']; var zz; // Bracket notation property access using value of other type on type with numeric index signature and no string index signature and string index signature -var zzzz = bothIndex[window]; +var zzzz = bothIndex[window];// Error diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.js index a188e7c9557..d1e26d9779e 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints.js @@ -42,7 +42,7 @@ var C = (function () { } C.prototype.f = function () { var x; - var a = x['getDate'](); + var a = x['getDate']();// number return a + x.getDate(); }; return C; @@ -56,7 +56,7 @@ var r3 = a().getDate(); var r3b = a()['getDate'](); var b = { foo: function (x) { - var a = x['getDate'](); + var a = x['getDate']();// number return a + x.getDate(); } }; diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js index 0dc561bc108..7996db794d3 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints2.js @@ -112,11 +112,11 @@ var C = (function () { } C.prototype.f = function () { var x; - var a = x['foo'](); + var a = x['foo']();// should be string return a + x.foo(); }; C.prototype.g = function (x) { - var a = x['foo'](); + var a = x['foo']();// should be string return a + x.foo(); }; return C; @@ -154,7 +154,7 @@ var r3c = a(aB, aB).foo(); var r3d = a(aB, aB)['foo'](); var b = { foo: function (x, y) { - var a = x['foo'](); + var a = x['foo']();// should be string return a + x.foo(); } }; @@ -164,4 +164,4 @@ var b = { // return a + x.foo(); // } //} -var r4 = b.foo(aB, aB); +var r4 = b.foo(aB, aB);// no inferences for T so constraint isn't satisfied, error diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js index ed5fa969818..32bc234f9e8 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints3.js @@ -88,12 +88,12 @@ var C = (function () { C.prototype.f = function () { var x; // BUG 823818 - var a = x['foo'](); + var a = x['foo']();// should be string return a + x.foo(); }; C.prototype.g = function (x) { // BUG 823818 - var a = x['foo'](); + var a = x['foo']();// should be string return a + x.foo(); }; return C; @@ -104,16 +104,16 @@ var i; var r2 = i.foo.foo(); var r2b = i.foo['foo'](); var a; -var r3 = a().foo(); +var r3 = a().foo();// error, no inferences for U so it doesn't satisfy constraint var r3b = a()['foo'](); // parameter supplied for type argument inference for U -var r3c = a(new B()).foo(); -var r3d = a(new B())['foo'](); +var r3c = a(new B()).foo();// valid call to an invalid function, U is inferred as B, which has a foo +var r3d = a(new B())['foo']();// valid call to an invalid function, U is inferred as B, which has a foo var b = { foo: function (x) { // BUG 823818 - var a = x['foo'](); + var a = x['foo']();// should be string return a + x.foo(); } }; -var r4 = b.foo(new B()); +var r4 = b.foo(new B());// valid call to an invalid function diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints4.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints4.js index 05a0b9203b9..1ffd2e7c784 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints4.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints4.js @@ -38,7 +38,7 @@ var C = (function () { } C.prototype.f = function () { var x; - var a = x['notHere'](); + var a = x['notHere']();// should be string return a + x.notHere(); }; return C; @@ -52,7 +52,7 @@ var r3 = a().notHere(); var r3b = a()['notHere'](); var b = { foo: function (x) { - var a = x['notHere'](); + var a = x['notHere']();// should be string return a + x.notHere(); }, bar: b.foo().notHere() diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js index 776d8d803b7..840fd78a625 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithConstraints5.js @@ -74,7 +74,7 @@ var C = (function () { } C.prototype.f = function () { var x; - var a = x['foo'](); + var a = x['foo']();// should be string return a + x.foo() + x.notHere(); }; return C; @@ -89,10 +89,10 @@ var r3 = a().notHere(); var r3b = a()['foo'](); var b = { foo: function (x) { - var a = x['foo'](); + var a = x['foo']();// should be string return a + x.notHere(); }, // BUG 794164 bar: b.foo(1).notHere() }; -var r4 = b.foo(new B()); +var r4 = b.foo(new B());// error after constraints above made illegal, doesn't matter diff --git a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.js b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.js index 812186a24ba..b9fded8ae06 100644 --- a/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.js +++ b/tests/baselines/reference/propertyAccessOnTypeParameterWithoutConstraints.js @@ -37,7 +37,7 @@ var C = (function () { } C.prototype.f = function () { var x; - var a = x['toString'](); + var a = x['toString']();// should be string return a + x.toString(); }; return C; @@ -51,7 +51,7 @@ var r3 = a().toString(); var r3b = a()['toString'](); var b = { foo: function (x) { - var a = x['toString'](); + var a = x['toString']();// should be string return a + x.toString(); } }; diff --git a/tests/baselines/reference/propertyAndFunctionWithSameName.js b/tests/baselines/reference/propertyAndFunctionWithSameName.js index 5b9d159339e..3b80aa355da 100644 --- a/tests/baselines/reference/propertyAndFunctionWithSameName.js +++ b/tests/baselines/reference/propertyAndFunctionWithSameName.js @@ -24,6 +24,6 @@ var D = (function () { function D() { } D.prototype.x = function (v) { - }; + };// error return D; })(); diff --git a/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.js b/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.js index 84c13dd1416..f5b08d457a7 100644 --- a/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.js +++ b/tests/baselines/reference/propertyIdentityWithPrivacyMismatch.js @@ -31,7 +31,7 @@ var y: Foo2; //// [propertyIdentityWithPrivacyMismatch_1.js] define(["require", "exports"], function (require, exports) { var x; - var x; + var x;// Should be error (mod1.Foo !== mod2.Foo) var Foo1 = (function () { function Foo1() { } diff --git a/tests/baselines/reference/propertyNamesWithStringLiteral.js b/tests/baselines/reference/propertyNamesWithStringLiteral.js index 3b22a44eddb..2f3def6116a 100644 --- a/tests/baselines/reference/propertyNamesWithStringLiteral.js +++ b/tests/baselines/reference/propertyNamesWithStringLiteral.js @@ -27,5 +27,5 @@ var Color; Color.namedColors; })(Color || (Color = {})); var a = Color.namedColors["azure"]; -var a = Color.namedColors.blue; -var a = Color.namedColors["pale blue"]; +var a = Color.namedColors.blue;// Should not error +var a = Color.namedColors["pale blue"];// should not error diff --git a/tests/baselines/reference/propertyOrdering.js b/tests/baselines/reference/propertyOrdering.js index 0bd71306382..ad844fcf54f 100644 --- a/tests/baselines/reference/propertyOrdering.js +++ b/tests/baselines/reference/propertyOrdering.js @@ -26,14 +26,14 @@ class Bar { //// [propertyOrdering.js] var Foo = (function () { function Foo(store) { - this._store = store; + this._store = store;// no repro if this is first line in class body } Foo.prototype.foo = function () { return this._store.length; }; Foo.prototype.bar = function () { return this.store; - }; + };// should be an error return Foo; })(); var Bar = (function () { diff --git a/tests/baselines/reference/propertyParameterWithQuestionMark.js b/tests/baselines/reference/propertyParameterWithQuestionMark.js index 626f740d5cd..09f098123b0 100644 --- a/tests/baselines/reference/propertyParameterWithQuestionMark.js +++ b/tests/baselines/reference/propertyParameterWithQuestionMark.js @@ -17,7 +17,7 @@ var C = (function () { return C; })(); // x should not be an optional property -var v = {}; +var v = {};// Should fail var v2; v = v2; -var v3 = new C; +var v3 = new C;// Should succeed diff --git a/tests/baselines/reference/qualifiedModuleLocals.js b/tests/baselines/reference/qualifiedModuleLocals.js index 9bdfe20d53a..62f3a25327b 100644 --- a/tests/baselines/reference/qualifiedModuleLocals.js +++ b/tests/baselines/reference/qualifiedModuleLocals.js @@ -18,6 +18,6 @@ var A; function a() { A.b(); } - A.a = a; + A.a = a;// A.b should be an unresolved symbol error })(A || (A = {})); A.a(); diff --git a/tests/baselines/reference/recursiveBaseConstructorCreation1.js b/tests/baselines/reference/recursiveBaseConstructorCreation1.js index 808d876d019..6bc6eee8633 100644 --- a/tests/baselines/reference/recursiveBaseConstructorCreation1.js +++ b/tests/baselines/reference/recursiveBaseConstructorCreation1.js @@ -27,4 +27,4 @@ var C2 = (function (_super) { } return C2; })(C1); -var x = new C2(); +var x = new C2();// Valid diff --git a/tests/baselines/reference/recursiveBaseConstructorCreation2.js b/tests/baselines/reference/recursiveBaseConstructorCreation2.js index 465b87d80e5..6b9d35f4592 100644 --- a/tests/baselines/reference/recursiveBaseConstructorCreation2.js +++ b/tests/baselines/reference/recursiveBaseConstructorCreation2.js @@ -15,4 +15,4 @@ var bar = new xyz(); // Error: Invalid 'new' expression. //// [recursiveBaseConstructorCreation2.js] -var bar = new xyz(); +var bar = new xyz();// Error: Invalid 'new' expression. diff --git a/tests/baselines/reference/recursiveBaseConstructorCreation3.js b/tests/baselines/reference/recursiveBaseConstructorCreation3.js index 11f03fa7f12..fb4ea460f0e 100644 --- a/tests/baselines/reference/recursiveBaseConstructorCreation3.js +++ b/tests/baselines/reference/recursiveBaseConstructorCreation3.js @@ -11,5 +11,5 @@ var bar = new xyz(); // Error: Invalid 'new' expression. var r: xyz = bar.foo; //// [recursiveBaseConstructorCreation3.js] -var bar = new xyz(); +var bar = new xyz();// Error: Invalid 'new' expression. var r = bar.foo; diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType1.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType1.js index 9266faa3979..0ff8d71997a 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType1.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType1.js @@ -27,5 +27,5 @@ define(["require", "exports"], function (require, exports) { }); //// [recursiveExportAssignmentAndFindAliasedType1_moduleA.js] define(["require", "exports"], function (require, exports) { - exports.b; + exports.b;// This should result in type ClassB }); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType2.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType2.js index 644c5924970..98cde7379f9 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType2.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType2.js @@ -31,5 +31,5 @@ define(["require", "exports"], function (require, exports) { }); //// [recursiveExportAssignmentAndFindAliasedType2_moduleA.js] define(["require", "exports"], function (require, exports) { - exports.b; + exports.b;// This should result in type ClassB }); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType3.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType3.js index 61a68e8321a..cbc99cc6da7 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType3.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType3.js @@ -35,5 +35,5 @@ define(["require", "exports"], function (require, exports) { }); //// [recursiveExportAssignmentAndFindAliasedType3_moduleA.js] define(["require", "exports"], function (require, exports) { - exports.b; + exports.b;// This should result in type ClassB }); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType4.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType4.js index 3c600641d0f..924ea769c9c 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType4.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType4.js @@ -28,5 +28,5 @@ define(["require", "exports"], function (require, exports) { }); //// [recursiveExportAssignmentAndFindAliasedType4_moduleA.js] define(["require", "exports"], function (require, exports) { - exports.b; + exports.b;// This should result in type ClassB }); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType5.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType5.js index 9d40dfc38e8..65b6a3e72d0 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType5.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType5.js @@ -36,5 +36,5 @@ define(["require", "exports"], function (require, exports) { }); //// [recursiveExportAssignmentAndFindAliasedType5_moduleA.js] define(["require", "exports"], function (require, exports) { - exports.b; + exports.b;// This should result in type ClassB }); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType6.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType6.js index 302c331c7e2..e5f6e384845 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType6.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType6.js @@ -44,5 +44,5 @@ define(["require", "exports"], function (require, exports) { }); //// [recursiveExportAssignmentAndFindAliasedType6_moduleA.js] define(["require", "exports"], function (require, exports) { - exports.b; + exports.b;// This should result in type ClassB }); diff --git a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType7.js b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType7.js index a14aebe032e..6070865a928 100644 --- a/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType7.js +++ b/tests/baselines/reference/recursiveExportAssignmentAndFindAliasedType7.js @@ -46,5 +46,5 @@ define(["require", "exports"], function (require, exports) { }); //// [recursiveExportAssignmentAndFindAliasedType7_moduleA.js] define(["require", "exports"], function (require, exports) { - exports.b; + exports.b;// This should result in type ClassB }); diff --git a/tests/baselines/reference/recursiveFunctionTypes.js b/tests/baselines/reference/recursiveFunctionTypes.js index 5c3fbeb5579..94b63527e26 100644 --- a/tests/baselines/reference/recursiveFunctionTypes.js +++ b/tests/baselines/reference/recursiveFunctionTypes.js @@ -48,8 +48,8 @@ f7(); // ok function fn() { return 1; } -var x = fn; -var y = fn; +var x = fn;// error +var y = fn;// ok var f; var g; function f1(d) { @@ -61,7 +61,7 @@ function g2() { function f3() { return f3; } -var a = f3; +var a = f3;// error var C = (function () { function C() { } diff --git a/tests/baselines/reference/recursiveIdenticalAssignment.js b/tests/baselines/reference/recursiveIdenticalAssignment.js index 31987aa7866..5520052c02b 100644 --- a/tests/baselines/reference/recursiveIdenticalAssignment.js +++ b/tests/baselines/reference/recursiveIdenticalAssignment.js @@ -13,4 +13,4 @@ var b: B> = a // Error, any does not satisfy constraint B> //// [recursiveIdenticalAssignment.js] var a; -var b = a; +var b = a// Error, any does not satisfy constraint B> ;// Error, any does not satisfy constraint B> diff --git a/tests/baselines/reference/recursiveInitializer.js b/tests/baselines/reference/recursiveInitializer.js index 9afe964b457..e8c0748541f 100644 --- a/tests/baselines/reference/recursiveInitializer.js +++ b/tests/baselines/reference/recursiveInitializer.js @@ -32,7 +32,7 @@ var s4 = '' + s4; // boolean unless otherwise specified var b1 = !b1; var b2 = !!b2; -var b3 = !b3 || b3; -var b4 = (!b4) && b4; +var b3 = !b3 || b3;// expected boolean here. actually 'any' +var b4 = (!b4) && b4;// expected boolean here. actually 'any' // (x:string) => any var f = function (x) { return f(x); }; diff --git a/tests/baselines/reference/recursiveTypeInGenericConstraint.js b/tests/baselines/reference/recursiveTypeInGenericConstraint.js index 7f4e9845b95..341297a549b 100644 --- a/tests/baselines/reference/recursiveTypeInGenericConstraint.js +++ b/tests/baselines/reference/recursiveTypeInGenericConstraint.js @@ -29,4 +29,4 @@ var D = (function () { } return D; })(); -var c1 = new Foo(); +var c1 = new Foo();// ok, circularity in assignment compat check causes success diff --git a/tests/baselines/reference/returnStatements.js b/tests/baselines/reference/returnStatements.js index 2ea93c38e98..d38c7d6211f 100644 --- a/tests/baselines/reference/returnStatements.js +++ b/tests/baselines/reference/returnStatements.js @@ -55,7 +55,7 @@ function fn7() { } function fn8() { return; -} +}// OK, eq. to 'return undefined' var C = (function () { function C() { } diff --git a/tests/baselines/reference/returnTypeParameter.js b/tests/baselines/reference/returnTypeParameter.js index 21df0144a85..2207788161c 100644 --- a/tests/baselines/reference/returnTypeParameter.js +++ b/tests/baselines/reference/returnTypeParameter.js @@ -4,7 +4,7 @@ function f2(a: T): T { return T; } // bug was that this satisfied the return //// [returnTypeParameter.js] function f(a) { -} +}// error, no return statement function f2(a) { return T; -} +}// bug was that this satisfied the return statement requirement diff --git a/tests/baselines/reference/scopingInCatchBlocks.js b/tests/baselines/reference/scopingInCatchBlocks.js index 9067a6b1ffd..08911a65446 100644 --- a/tests/baselines/reference/scopingInCatchBlocks.js +++ b/tests/baselines/reference/scopingInCatchBlocks.js @@ -24,4 +24,4 @@ try { } catch (ex1) { } -var x = ex1; +var x = ex1;// should error diff --git a/tests/baselines/reference/sourceMapValidationClasses.js b/tests/baselines/reference/sourceMapValidationClasses.js index ce8635c26ab..0f1aeb2fc4b 100644 --- a/tests/baselines/reference/sourceMapValidationClasses.js +++ b/tests/baselines/reference/sourceMapValidationClasses.js @@ -60,7 +60,7 @@ var Foo; for (var _i = 1; _i < arguments.length; _i++) { restGreetings[_i - 1] = arguments[_i]; } - var greeters = []; + var greeters = [];/* inline block comment */ greeters[0] = new Greeter(greeting); for (var i = 0; i < restGreetings.length; i++) { greeters.push(new Greeter(restGreetings[i])); diff --git a/tests/baselines/reference/sourceMapValidationClasses.js.map b/tests/baselines/reference/sourceMapValidationClasses.js.map index c43b1d9ff22..9a88d17d74c 100644 --- a/tests/baselines/reference/sourceMapValidationClasses.js.map +++ b/tests/baselines/reference/sourceMapValidationClasses.js.map @@ -1,2 +1,2 @@ //// [sourceMapValidationClasses.js.map] -{"version":3,"file":"sourceMapValidationClasses.js","sourceRoot":"","sources":["sourceMapValidationClasses.ts"],"names":["Foo","Foo.Bar","Foo.Bar.Greeter","Foo.Bar.Greeter.constructor","Foo.Bar.Greeter.greet","Foo.Bar.foo","Foo.Bar.foo2"],"mappings":"AAAA,IAAO,GAAG,CAmCT;AAnCD,WAAO,GAAG;IAACA,WAAAA,GAAGA,EAACA,CAACA;QACZC,YAAYA,CAACA;QAEbA,IAAMA,OAAOA;YACTC,SADEA,OAAOA,CACUA,QAAgBA;gBAAhBC,aAAQA,GAARA,QAAQA,CAAQA;YACnCA,CAACA;YAEDD,uBAAKA,GAALA;gBACIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;YAC5CA,CAACA;YACLF,cAACA;QAADA,CAACA,AAPDD,IAOCA;QAGDA,SAASA,GAAGA,CAACA,QAAgBA;YACzBI,MAAMA,CAACA,IAAIA,OAAOA,CAACA,QAAQA,CAACA,CAACA;QACjCA,CAACA;QAEDJ,IAAIA,OAAOA,GAAGA,IAAIA,OAAOA,CAACA,eAAeA,CAACA,CAACA;QAC3CA,IAAIA,GAAGA,GAAGA,OAAOA,CAACA,KAAKA,EAAEA,CAACA;QAE1BA,SAASA,IAAIA,CAACA,QAAgBA;YAAEK,uBAA8CA;iBAA9CA,WAA8CA,CAA9CA,sBAA8CA,CAA9CA,IAA8CA;gBAA9CA,sCAA8CA;;YAC1EA,IAAIA,QAAQA,GAAcA,EAAEA,CAACA;YAC7BA,QAAQA,CAACA,CAACA,CAACA,GAAGA,IAAIA,OAAOA,CAACA,QAAQA,CAACA,CAACA;YACpCA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,aAAaA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;gBAC5CA,QAAQA,CAACA,IAAIA,CAACA,IAAIA,OAAOA,CAACA,aAAaA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;YACjDA,CAACA;YAEDA,MAAMA,CAACA,QAAQA,CAACA;QACpBA,CAACA;QAEDL,IAAIA,CAACA,GAAGA,IAAIA,CAACA,OAAOA,EAAEA,OAAOA,EAAEA,GAAGA,CAACA,CAACA;QAEpCA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,CAACA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChCA,CAACA,CAACA,CAACA,CAACA,CAACA,KAAKA,EAAEA,CAACA;QACjBA,CAACA;IACLA,CAACA,EAnCUD,OAAGA,KAAHA,OAAGA,QAmCbA;IAnCUA,IAAAA,GAAGA,GAAHA,OAmCVA,CAAAA;AAADA,CAACA,EAnCM,GAAG,KAAH,GAAG,QAmCT"} \ No newline at end of file +{"version":3,"file":"sourceMapValidationClasses.js","sourceRoot":"","sources":["sourceMapValidationClasses.ts"],"names":["Foo","Foo.Bar","Foo.Bar.Greeter","Foo.Bar.Greeter.constructor","Foo.Bar.Greeter.greet","Foo.Bar.foo","Foo.Bar.foo2"],"mappings":"AAAA,IAAO,GAAG,CAmCT;AAnCD,WAAO,GAAG;IAACA,WAAAA,GAAGA,EAACA,CAACA;QACZC,YAAYA,CAACA;QAEbA,IAAMA,OAAOA;YACTC,SADEA,OAAOA,CACUA,QAAgBA;gBAAhBC,aAAQA,GAARA,QAAQA,CAAQA;YACnCA,CAACA;YAEDD,uBAAKA,GAALA;gBACIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;YAC5CA,CAACA;YACLF,cAACA;QAADA,CAACA,AAPDD,IAOCA;QAGDA,SAASA,GAAGA,CAACA,QAAgBA;YACzBI,MAAMA,CAACA,IAAIA,OAAOA,CAACA,QAAQA,CAACA,CAACA;QACjCA,CAACA;QAEDJ,IAAIA,OAAOA,GAAGA,IAAIA,OAAOA,CAACA,eAAeA,CAACA,CAACA;QAC3CA,IAAIA,GAAGA,GAAGA,OAAOA,CAACA,KAAKA,EAAEA,CAACA;QAE1BA,SAASA,IAAIA,CAACA,QAAgBA;YAAEK,uBAA8CA;iBAA9CA,WAA8CA,CAA9CA,sBAA8CA,CAA9CA,IAA8CA;gBAA9CA,sCAA8CA;;YAC1EA,IAAIA,QAAQA,GAAcA,EAAEA,CAAEA,0BAA0BA,CAA3BA;YAC7BA,QAAQA,CAACA,CAACA,CAACA,GAAGA,IAAIA,OAAOA,CAACA,QAAQA,CAACA,CAACA;YACpCA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,aAAaA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;gBAC5CA,QAAQA,CAACA,IAAIA,CAACA,IAAIA,OAAOA,CAACA,aAAaA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;YACjDA,CAACA;YAEDA,MAAMA,CAACA,QAAQA,CAACA;QACpBA,CAACA;QAEDL,IAAIA,CAACA,GAAGA,IAAIA,CAACA,OAAOA,EAAEA,OAAOA,EAAEA,GAAGA,CAACA,CAACA;QAEpCA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,CAACA,CAACA,MAAMA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YAChCA,CAACA,CAACA,CAACA,CAACA,CAACA,KAAKA,EAAEA,CAACA;QACjBA,CAACA;IACLA,CAACA,EAnCUD,OAAGA,KAAHA,OAAGA,QAmCbA;IAnCUA,IAAAA,GAAGA,GAAHA,OAmCVA,CAAAA;AAADA,CAACA,EAnCM,GAAG,KAAH,GAAG,QAmCT"} \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt b/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt index 3b64907b012..910083a11f4 100644 --- a/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt +++ b/tests/baselines/reference/sourceMapValidationClasses.sourcemap.txt @@ -436,30 +436,35 @@ sourceFile:sourceMapValidationClasses.ts 2 >Emitted(22, 55) Source(21, 83) + SourceIndex(0) name (Foo.Bar.foo2) --- >>> } ->>> var greeters = []; +>>> var greeters = [];/* inline block comment */ 1 >^^^^^^^^^^^^ 2 > ^^^^ 3 > ^^^^^^^^ 4 > ^^^ 5 > ^^ 6 > ^ -7 > ^^^^^^^^^^^^^^^^^^^-> +7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^ +8 > ^ 1 >) { > 2 > var 3 > greeters 4 > : Greeter[] = 5 > [] -6 > ; +6 > ; +7 > /* inline block comment */ +8 > 1 >Emitted(24, 13) Source(22, 9) + SourceIndex(0) name (Foo.Bar.foo2) 2 >Emitted(24, 17) Source(22, 13) + SourceIndex(0) name (Foo.Bar.foo2) 3 >Emitted(24, 25) Source(22, 21) + SourceIndex(0) name (Foo.Bar.foo2) 4 >Emitted(24, 28) Source(22, 35) + SourceIndex(0) name (Foo.Bar.foo2) 5 >Emitted(24, 30) Source(22, 37) + SourceIndex(0) name (Foo.Bar.foo2) -6 >Emitted(24, 31) Source(22, 38) + SourceIndex(0) name (Foo.Bar.foo2) +6 >Emitted(24, 31) Source(22, 39) + SourceIndex(0) name (Foo.Bar.foo2) +7 >Emitted(24, 57) Source(22, 65) + SourceIndex(0) name (Foo.Bar.foo2) +8 >Emitted(24, 58) Source(22, 38) + SourceIndex(0) name (Foo.Bar.foo2) --- >>> greeters[0] = new Greeter(greeting); -1->^^^^^^^^^^^^ +1 >^^^^^^^^^^^^ 2 > ^^^^^^^^ 3 > ^ 4 > ^ @@ -472,7 +477,7 @@ sourceFile:sourceMapValidationClasses.ts 11> ^ 12> ^ 13> ^^^^^^^^^^^^^-> -1-> /* inline block comment */ +1 > /* inline block comment */ > 2 > greeters 3 > [ @@ -485,7 +490,7 @@ sourceFile:sourceMapValidationClasses.ts 10> greeting 11> ) 12> ; -1->Emitted(25, 13) Source(23, 9) + SourceIndex(0) name (Foo.Bar.foo2) +1 >Emitted(25, 13) Source(23, 9) + SourceIndex(0) name (Foo.Bar.foo2) 2 >Emitted(25, 21) Source(23, 17) + SourceIndex(0) name (Foo.Bar.foo2) 3 >Emitted(25, 22) Source(23, 18) + SourceIndex(0) name (Foo.Bar.foo2) 4 >Emitted(25, 23) Source(23, 19) + SourceIndex(0) name (Foo.Bar.foo2) diff --git a/tests/baselines/reference/specializedInheritedConstructors1.js b/tests/baselines/reference/specializedInheritedConstructors1.js index d20793629a2..d65230a4654 100644 --- a/tests/baselines/reference/specializedInheritedConstructors1.js +++ b/tests/baselines/reference/specializedInheritedConstructors1.js @@ -44,4 +44,4 @@ var MyView = (function (_super) { var m = { model: new Model() }; var aView = new View({ model: new Model() }); var aView2 = new View(m); -var myView = new MyView(m); +var myView = new MyView(m);// was error diff --git a/tests/baselines/reference/staticInheritance.js b/tests/baselines/reference/staticInheritance.js index a73c0747499..aacdb95641c 100644 --- a/tests/baselines/reference/staticInheritance.js +++ b/tests/baselines/reference/staticInheritance.js @@ -22,7 +22,7 @@ function doThing(x) { } var A = (function () { function A() { - this.p = doThing(A); + this.p = doThing(A);// OK } return A; })(); @@ -30,8 +30,8 @@ var B = (function (_super) { __extends(B, _super); function B() { _super.apply(this, arguments); - this.p1 = doThing(A); - this.p2 = doThing(B); + this.p1 = doThing(A);// OK + this.p2 = doThing(B);// OK } return B; })(A); diff --git a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.js b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.js index 7f06aa0b9f1..bae1e6c189f 100644 --- a/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.js +++ b/tests/baselines/reference/staticMemberAssignsToConstructorFunctionMembers.js @@ -22,7 +22,7 @@ var C = (function () { }; C.bar = function (x) { C.bar = function () { - }; + }// error ; C.bar = function (x) { return x; }; C.bar = function (x) { return 1; }; return 1; diff --git a/tests/baselines/reference/staticMemberExportAccess.js b/tests/baselines/reference/staticMemberExportAccess.js index 5c3700bcf41..d8d0271756d 100644 --- a/tests/baselines/reference/staticMemberExportAccess.js +++ b/tests/baselines/reference/staticMemberExportAccess.js @@ -37,9 +37,9 @@ var Sammy; Sammy.x = 1; })(Sammy || (Sammy = {})); var $; -var instanceOfClassSammy = new $.sammy(); -var r1 = instanceOfClassSammy.foo(); +var instanceOfClassSammy = new $.sammy();// should be error +var r1 = instanceOfClassSammy.foo();// r1 is string var r2 = $.sammy.foo(); -var r3 = $.sammy.bar(); -var r4 = $.sammy.x; +var r3 = $.sammy.bar();// error +var r4 = $.sammy.x;// error Sammy.bar(); diff --git a/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.js b/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.js index 85e575f74a9..7e851286ae5 100644 --- a/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.js +++ b/tests/baselines/reference/staticMemberOfClassAndPublicMemberOfAnotherClassAssignment.js @@ -44,7 +44,7 @@ var a = new B(); a = new C(); a = B; a = C; -var b = new C(); +var b = new C();// error name is missing b = B; b = C; b = a; diff --git a/tests/baselines/reference/staticMethodReferencingTypeArgument1.js b/tests/baselines/reference/staticMethodReferencingTypeArgument1.js index e9ff32877ad..b2e84abcc5b 100644 --- a/tests/baselines/reference/staticMethodReferencingTypeArgument1.js +++ b/tests/baselines/reference/staticMethodReferencingTypeArgument1.js @@ -25,7 +25,7 @@ var Editor; this.data = data; } List.MakeHead = function () { - var entry = new List(true, null); + var entry = new List(true, null);// can't access T here entry.prev = entry; entry.next = entry; return entry; diff --git a/tests/baselines/reference/staticPropSuper.js b/tests/baselines/reference/staticPropSuper.js index b1fc30e9387..3f248e2e363 100644 --- a/tests/baselines/reference/staticPropSuper.js +++ b/tests/baselines/reference/staticPropSuper.js @@ -50,7 +50,7 @@ var A = (function () { var B = (function (_super) { __extends(B, _super); function B() { - var x = 1; + var x = 1;// should not error _super.call(this); } B.s = 9; @@ -60,7 +60,7 @@ var C = (function (_super) { __extends(C, _super); function C() { this.p = 10; - var x = 1; + var x = 1;// should error } return C; })(A); @@ -68,7 +68,7 @@ var D = (function (_super) { __extends(D, _super); function D() { this.p = 11; - var x = 1; + var x = 1;// should error } return D; })(A); @@ -76,7 +76,7 @@ var E = (function (_super) { __extends(E, _super); function E() { this.p = 12; - var x = 1; + var x = 1;// should error } return E; })(A); diff --git a/tests/baselines/reference/staticsNotInScopeInClodule.js b/tests/baselines/reference/staticsNotInScopeInClodule.js index 63c8ee16f66..922e1927345 100644 --- a/tests/baselines/reference/staticsNotInScopeInClodule.js +++ b/tests/baselines/reference/staticsNotInScopeInClodule.js @@ -16,5 +16,5 @@ var Clod = (function () { })(); var Clod; (function (Clod) { - var p = x; + var p = x;// x isn't in scope here })(Clod || (Clod = {})); diff --git a/tests/baselines/reference/strictModeInConstructor.js b/tests/baselines/reference/strictModeInConstructor.js index 2128cbfc173..b017b05e45d 100644 --- a/tests/baselines/reference/strictModeInConstructor.js +++ b/tests/baselines/reference/strictModeInConstructor.js @@ -94,7 +94,7 @@ var D = (function (_super) { __extends(D, _super); function D() { this.s = 9; - var x = 1; + var x = 1;// Error _super.call(this); "use strict"; } @@ -121,7 +121,7 @@ var Cs = (function (_super) { var Ds = (function (_super) { __extends(Ds, _super); function Ds() { - var x = 1; + var x = 1;// no Error _super.call(this); "use strict"; } diff --git a/tests/baselines/reference/stringPropertyAccessWithError.js b/tests/baselines/reference/stringPropertyAccessWithError.js index 3b507ceb7f9..b80813da6f9 100644 --- a/tests/baselines/reference/stringPropertyAccessWithError.js +++ b/tests/baselines/reference/stringPropertyAccessWithError.js @@ -4,4 +4,4 @@ var d = x['charAt']('invalid'); // error //// [stringPropertyAccessWithError.js] var x = ''; -var d = x['charAt']('invalid'); +var d = x['charAt']('invalid');// error diff --git a/tests/baselines/reference/subtypesOfTypeParameter.js b/tests/baselines/reference/subtypesOfTypeParameter.js index c38b281f5ef..8c053bcaeed 100644 --- a/tests/baselines/reference/subtypesOfTypeParameter.js +++ b/tests/baselines/reference/subtypesOfTypeParameter.js @@ -126,8 +126,8 @@ var D1 = (function (_super) { return D1; })(C3); function f1(x, y) { - var r = true ? x : y; - var r = true ? y : x; + var r = true ? x : y;// error + var r = true ? y : x;// error } var C1 = (function () { function C1() { @@ -186,7 +186,7 @@ function f2(x, y) { } : x; var r8b = true ? x : function (x) { return x; - }; + };// type parameters not identical across declarations var i1; var r9 = true ? i1 : x; var r9 = true ? x : i1; @@ -214,8 +214,8 @@ function f2(x, y) { var r18 = true ? x : a; var r18 = true ? a : x; } - var r19 = true ? new Object() : x; - var r19 = true ? x : new Object(); - var r20 = true ? {} : x; - var r20 = true ? x : {}; + var r19 = true ? new Object() : x;// BCT is Object + var r19 = true ? x : new Object();// BCT is Object + var r20 = true ? {} : x;// ok + var r20 = true ? x : {};// ok } diff --git a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.js b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.js index 66f00386d72..8516f275089 100644 --- a/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.js +++ b/tests/baselines/reference/subtypesOfTypeParameterWithConstraints2.js @@ -215,96 +215,96 @@ var c; c.bar = 1; })(c || (c = {})); function f4(x) { - var r0 = true ? x : null; - var r0 = true ? null : x; + var r0 = true ? x : null;// ok + var r0 = true ? null : x;// ok var u; - var r0b = true ? u : x; - var r0b = true ? x : u; + var r0b = true ? u : x;// ok + var r0b = true ? x : u;// ok } function f5(x) { - var r1 = true ? 1 : x; - var r1 = true ? x : 1; + var r1 = true ? 1 : x;// error + var r1 = true ? x : 1;// error } function f6(x) { - var r2 = true ? '' : x; - var r2 = true ? x : ''; + var r2 = true ? '' : x;// error + var r2 = true ? x : '';// error } function f7(x) { - var r3 = true ? true : x; - var r3 = true ? x : true; + var r3 = true ? true : x;// error + var r3 = true ? x : true;// error } function f8(x) { - var r4 = true ? new Date() : x; - var r4 = true ? x : new Date(); + var r4 = true ? new Date() : x;// ok + var r4 = true ? x : new Date();// ok } function f9(x) { - var r5 = true ? /1/ : x; - var r5 = true ? x : /1/; + var r5 = true ? /1/ : x;// ok + var r5 = true ? x : /1/;// ok } function f10(x) { - var r6 = true ? { foo: 1 } : x; - var r6 = true ? x : { foo: 1 }; + var r6 = true ? { foo: 1 } : x;// ok + var r6 = true ? x : { foo: 1 };// ok } function f11(x) { var r7 = true ? function () { - } : x; + } : x;// ok var r7 = true ? x : function () { - }; + };// ok } function f12(x) { var r8 = true ? function (x) { return x; - } : x; + } : x;// ok var r8b = true ? x : function (x) { return x; - }; + };// ok, type parameters not identical across declarations } function f13(x) { var i1; - var r9 = true ? i1 : x; - var r9 = true ? x : i1; + var r9 = true ? i1 : x;// ok + var r9 = true ? x : i1;// ok } function f14(x) { var c1; - var r10 = true ? c1 : x; - var r10 = true ? x : c1; + var r10 = true ? c1 : x;// ok + var r10 = true ? x : c1;// ok } function f15(x) { var c2; - var r12 = true ? c2 : x; - var r12 = true ? x : c2; + var r12 = true ? c2 : x;// ok + var r12 = true ? x : c2;// ok } function f16(x) { - var r13 = true ? E : x; - var r13 = true ? x : E; - var r14 = true ? 0 /* A */ : x; - var r14 = true ? x : 0 /* A */; + var r13 = true ? E : x;// BUG 831833 + var r13 = true ? x : E;// BUG 831833 + var r14 = true ? 0 /* A */ : x;// BUG 831833 + var r14 = true ? x : 0 /* A */;// BUG 831833 } function f17(x) { var af; - var r15 = true ? af : x; - var r15 = true ? x : af; + var r15 = true ? af : x;// ok + var r15 = true ? x : af;// ok } function f18(x) { var ac; - var r16 = true ? ac : x; - var r16 = true ? x : ac; + var r16 = true ? ac : x;// ok + var r16 = true ? x : ac;// ok } function f19(x) { function f17(a) { - var r17 = true ? x : a; - var r17 = true ? a : x; + var r17 = true ? x : a;// ok + var r17 = true ? a : x;// ok } function f18(a) { - var r18 = true ? x : a; - var r18 = true ? a : x; + var r18 = true ? x : a;// ok + var r18 = true ? a : x;// ok } } function f20(x) { - var r19 = true ? new Object() : x; - var r19 = true ? x : new Object(); + var r19 = true ? new Object() : x;// ok + var r19 = true ? x : new Object();// ok } function f21(x) { - var r20 = true ? {} : x; - var r20 = true ? x : {}; + var r20 = true ? {} : x;// ok + var r20 = true ? x : {};// ok } diff --git a/tests/baselines/reference/subtypingWithCallSignatures.js b/tests/baselines/reference/subtypingWithCallSignatures.js index 47bb32fcb2c..615c36665ab 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures.js +++ b/tests/baselines/reference/subtypingWithCallSignatures.js @@ -14,8 +14,8 @@ module CallSignature { //// [subtypingWithCallSignatures.js] var CallSignature; (function (CallSignature) { - var r = foo1(function (x) { return 1; }); - var r2 = foo1(function (x) { return ''; }); - var r3 = foo2(function (x, y) { return 1; }); - var r4 = foo2(function (x) { return ''; }); + var r = foo1(function (x) { return 1; });// ok because base returns void + var r2 = foo1(function (x) { return ''; });// ok because base returns void + var r3 = foo2(function (x, y) { return 1; });// ok because base returns void + var r4 = foo2(function (x) { return ''; });// ok because base returns void })(CallSignature || (CallSignature = {})); diff --git a/tests/baselines/reference/subtypingWithCallSignatures2.js b/tests/baselines/reference/subtypingWithCallSignatures2.js index 5d838be70aa..e566a884684 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures2.js +++ b/tests/baselines/reference/subtypingWithCallSignatures2.js @@ -208,9 +208,9 @@ var OtherDerived = (function (_super) { })(Base); var r1arg1 = function (x) { return [x]; }; var r1arg2 = function (x) { return [1]; }; -var r1 = foo1(r1arg1); -var r1a = [r1arg2, r1arg1]; -var r1b = [r1arg1, r1arg2]; +var r1 = foo1(r1arg1);// any, return types are not subtype of first overload +var r1a = [r1arg2, r1arg1];// generic signature, subtype in both directions +var r1b = [r1arg1, r1arg2];// generic signature, subtype in both directions var r2arg1 = function (x) { return ['']; }; var r2arg2 = function (x) { return ['']; }; var r2 = foo2(r2arg1); @@ -224,32 +224,32 @@ var r3a = [r3arg1, r3arg2]; var r3b = [r3arg2, r3arg1]; var r4arg1 = function (x, y) { return x; }; var r4arg2 = function (x, y) { return ''; }; -var r4 = foo4(r4arg1); +var r4 = foo4(r4arg1);// any var r4a = [r4arg1, r4arg2]; var r4b = [r4arg2, r4arg1]; var r5arg1 = function (x) { return null; }; var r5arg2 = function (x) { return ''; }; -var r5 = foo5(r5arg1); +var r5 = foo5(r5arg1);// any var r5a = [r5arg1, r5arg2]; var r5b = [r5arg2, r5arg1]; var r6arg1 = function (x) { return null; }; var r6arg2 = function (x) { return null; }; -var r6 = foo6(r6arg1); +var r6 = foo6(r6arg1);// any var r6a = [r6arg1, r6arg2]; var r6b = [r6arg2, r6arg1]; var r7arg1 = function (x) { return function (r) { return null; }; }; var r7arg2 = function (x) { return function (r) { return null; }; }; -var r7 = foo7(r7arg1); +var r7 = foo7(r7arg1);// any var r7a = [r7arg1, r7arg2]; var r7b = [r7arg2, r7arg1]; var r8arg1 = function (x, y) { return function (r) { return null; }; }; var r8arg2 = function (x, y) { return function (r) { return null; }; }; -var r8 = foo8(r8arg1); +var r8 = foo8(r8arg1);// any var r8a = [r8arg1, r8arg2]; var r8b = [r8arg2, r8arg1]; var r9arg1 = function (x, y) { return function (r) { return null; }; }; var r9arg2 = function (x, y) { return function (r) { return null; }; }; -var r9 = foo9(r9arg1); +var r9 = foo9(r9arg1);// any var r9a = [r9arg1, r9arg2]; var r9b = [r9arg2, r9arg1]; var r10arg1 = function () { @@ -266,34 +266,34 @@ var r10arg2 = function () { } return null; }; -var r10 = foo10(r10arg1); +var r10 = foo10(r10arg1);// any var r10a = [r10arg1, r10arg2]; var r10b = [r10arg2, r10arg1]; var r11arg1 = function (x, y) { return x; }; var r11arg2 = function (x, y) { return null; }; -var r11 = foo11(r11arg1); +var r11 = foo11(r11arg1);// any var r11a = [r11arg1, r11arg2]; var r11b = [r11arg2, r11arg1]; var r12arg1 = function (x, y) { return null; }; var r12arg2 = function (x, y) { return null; }; -var r12 = foo12(r12arg1); +var r12 = foo12(r12arg1);// any var r12a = [r12arg1, r12arg2]; var r12b = [r12arg2, r12arg1]; var r13arg1 = function (x, y) { return y; }; var r13arg2 = function (x, y) { return null; }; -var r13 = foo13(r13arg1); +var r13 = foo13(r13arg1);// any var r13a = [r13arg1, r13arg2]; var r13b = [r13arg2, r13arg1]; var r14arg1 = function (x) { return x.a; }; var r14arg2 = function (x) { return null; }; -var r14 = foo14(r14arg1); +var r14 = foo14(r14arg1);// any var r14a = [r14arg1, r14arg2]; var r14b = [r14arg2, r14arg1]; var r15arg1 = function (x) { return null; }; -var r15 = foo15(r15arg1); +var r15 = foo15(r15arg1);// any var r16arg1 = function (x) { return [1]; }; var r16 = foo16(r16arg1); var r17arg1 = function (x) { return null; }; -var r17 = foo17(r17arg1); +var r17 = foo17(r17arg1);// any var r18arg1 = function (x) { return null; }; var r18 = foo18(r18arg1); diff --git a/tests/baselines/reference/subtypingWithCallSignatures3.js b/tests/baselines/reference/subtypingWithCallSignatures3.js index da4c2cf4ec2..f1c2277b593 100644 --- a/tests/baselines/reference/subtypingWithCallSignatures3.js +++ b/tests/baselines/reference/subtypingWithCallSignatures3.js @@ -155,17 +155,17 @@ var Errors; } return OtherDerived; })(Base); - var r1 = foo2(function (x) { return null; }); + var r1 = foo2(function (x) { return null; });// any var r1a = [function (x) { return ['']; }, function (x) { return null; }]; var r1b = [function (x) { return null; }, function (x) { return ['']; }]; var r2arg = function (x) { return function (r) { return null; }; }; var r2arg2 = function (x) { return function (r) { return null; }; }; - var r2 = foo7(r2arg); + var r2 = foo7(r2arg);// any var r2a = [r2arg2, r2arg]; var r2b = [r2arg, r2arg2]; var r3arg = function (x, y) { return function (r) { return null; }; }; var r3arg2 = function (x, y) { return function (r) { return null; }; }; - var r3 = foo8(r3arg); + var r3 = foo8(r3arg);// any var r3a = [r3arg2, r3arg]; var r3b = [r3arg, r3arg2]; var r4arg = function () { @@ -182,37 +182,37 @@ var Errors; } return null; }; - var r4 = foo10(r4arg); + var r4 = foo10(r4arg);// any var r4a = [r4arg2, r4arg]; var r4b = [r4arg, r4arg2]; var r5arg = function (x, y) { return null; }; var r5arg2 = function (x, y) { return null; }; - var r5 = foo11(r5arg); + var r5 = foo11(r5arg);// any var r5a = [r5arg2, r5arg]; var r5b = [r5arg, r5arg2]; var r6arg = function (x, y) { return null; }; var r6arg2 = function (x, y) { return null; }; - var r6 = foo12(r6arg); + var r6 = foo12(r6arg);// (x: Array, y: Array) => Array var r6a = [r6arg2, r6arg]; var r6b = [r6arg, r6arg2]; var r7arg = function (x) { return null; }; var r7arg2 = function (x) { return 1; }; - var r7 = foo15(r7arg); + var r7 = foo15(r7arg);// any var r7a = [r7arg2, r7arg]; var r7b = [r7arg, r7arg2]; var r7arg3 = function (x) { return 1; }; - var r7c = foo15(r7arg3); + var r7c = foo15(r7arg3);// (x: { a: string; b: number }) => number): number; var r7d = [r7arg2, r7arg3]; var r7e = [r7arg3, r7arg2]; var r8arg = function (x) { return null; }; - var r8 = foo16(r8arg); + var r8 = foo16(r8arg);// any var r9arg = function (x) { return null; }; - var r9 = foo17(r9arg); + var r9 = foo17(r9arg);// (x: { (a: T): T; (a: T): T; }): any[]; (x: { (a: T): T; (a: T): T; }): any[]; })(Errors || (Errors = {})); var WithGenericSignaturesInBaseType; (function (WithGenericSignaturesInBaseType) { var r2arg2 = function (x) { return ['']; }; - var r2 = foo2(r2arg2); + var r2 = foo2(r2arg2);// (x:T) => T[] since we can infer from generic signatures now var r3arg2 = function (x) { return null; }; - var r3 = foo3(r3arg2); + var r3 = foo3(r3arg2);// any })(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {})); diff --git a/tests/baselines/reference/subtypingWithCallSignaturesA.js b/tests/baselines/reference/subtypingWithCallSignaturesA.js index 83ae6274847..1152a59c21a 100644 --- a/tests/baselines/reference/subtypingWithCallSignaturesA.js +++ b/tests/baselines/reference/subtypingWithCallSignaturesA.js @@ -3,4 +3,4 @@ declare function foo3(cb: (x: number) => number): typeof cb; var r5 = foo3((x: number) => ''); // error //// [subtypingWithCallSignaturesA.js] -var r5 = foo3(function (x) { return ''; }); +var r5 = foo3(function (x) { return ''; });// error diff --git a/tests/baselines/reference/subtypingWithConstructSignatures.js b/tests/baselines/reference/subtypingWithConstructSignatures.js index 043a0ae15f6..f222e1b24bc 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures.js @@ -19,11 +19,11 @@ module ConstructSignature { var ConstructSignature; (function (ConstructSignature) { var rarg1; - var r = foo1(rarg1); + var r = foo1(rarg1);// ok because base returns void var rarg2; - var r2 = foo1(rarg2); + var r2 = foo1(rarg2);// ok because base returns void var r3arg1; - var r3 = foo2(r3arg1); + var r3 = foo2(r3arg1);// ok because base returns void var r4arg1; - var r4 = foo2(r4arg1); + var r4 = foo2(r4arg1);// ok because base returns void })(ConstructSignature || (ConstructSignature = {})); diff --git a/tests/baselines/reference/subtypingWithConstructSignatures2.js b/tests/baselines/reference/subtypingWithConstructSignatures2.js index c42bbcd606b..47fd8ce11ce 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures2.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures2.js @@ -208,9 +208,9 @@ var OtherDerived = (function (_super) { })(Base); var r1arg1; var r1arg2; -var r1 = foo1(r1arg1); -var r1a = [r1arg2, r1arg1]; -var r1b = [r1arg1, r1arg2]; +var r1 = foo1(r1arg1);// any, return types are not subtype of first overload +var r1a = [r1arg2, r1arg1];// generic signature, subtype in both directions +var r1b = [r1arg1, r1arg2];// generic signature, subtype in both directions var r2arg1; var r2arg2; var r2 = foo2(r2arg1); @@ -223,64 +223,64 @@ var r3a = [r3arg1, r3arg2]; var r3b = [r3arg2, r3arg1]; var r4arg1; var r4arg2; -var r4 = foo4(r4arg1); +var r4 = foo4(r4arg1);// any var r4a = [r4arg1, r4arg2]; var r4b = [r4arg2, r4arg1]; var r5arg1; var r5arg2; -var r5 = foo5(r5arg1); +var r5 = foo5(r5arg1);// any var r5a = [r5arg1, r5arg2]; var r5b = [r5arg2, r5arg1]; var r6arg1; var r6arg2; -var r6 = foo6(r6arg1); +var r6 = foo6(r6arg1);// any var r6a = [r6arg1, r6arg2]; var r6b = [r6arg2, r6arg1]; var r7arg1; var r7arg2; -var r7 = foo7(r7arg1); +var r7 = foo7(r7arg1);// any var r7a = [r7arg1, r7arg2]; var r7b = [r7arg2, r7arg1]; var r8arg1; var r8arg2; -var r8 = foo8(r8arg1); +var r8 = foo8(r8arg1);// any var r8a = [r8arg1, r8arg2]; var r8b = [r8arg2, r8arg1]; var r9arg1; var r9arg2; -var r9 = foo9(r9arg1); +var r9 = foo9(r9arg1);// any var r9a = [r9arg1, r9arg2]; var r9b = [r9arg2, r9arg1]; var r10arg1; var r10arg2; -var r10 = foo10(r10arg1); +var r10 = foo10(r10arg1);// any var r10a = [r10arg1, r10arg2]; var r10b = [r10arg2, r10arg1]; var r11arg1; var r11arg2; -var r11 = foo11(r11arg1); +var r11 = foo11(r11arg1);// any var r11a = [r11arg1, r11arg2]; var r11b = [r11arg2, r11arg1]; var r12arg1; var r12arg2; -var r12 = foo12(r12arg1); +var r12 = foo12(r12arg1);// any var r12a = [r12arg1, r12arg2]; var r12b = [r12arg2, r12arg1]; var r13arg1; var r13arg2; -var r13 = foo13(r13arg1); +var r13 = foo13(r13arg1);// any var r13a = [r13arg1, r13arg2]; var r13b = [r13arg2, r13arg1]; var r14arg1; var r14arg2; -var r14 = foo14(r14arg1); +var r14 = foo14(r14arg1);// any var r14a = [r14arg1, r14arg2]; var r14b = [r14arg2, r14arg1]; var r15arg1; -var r15 = foo15(r15arg1); +var r15 = foo15(r15arg1);// any var r16arg1; var r16 = foo16(r16arg1); var r17arg1; -var r17 = foo17(r17arg1); +var r17 = foo17(r17arg1);// any var r18arg1; var r18 = foo18(r18arg1); diff --git a/tests/baselines/reference/subtypingWithConstructSignatures3.js b/tests/baselines/reference/subtypingWithConstructSignatures3.js index 8049413ba6f..698c80269d8 100644 --- a/tests/baselines/reference/subtypingWithConstructSignatures3.js +++ b/tests/baselines/reference/subtypingWithConstructSignatures3.js @@ -159,52 +159,52 @@ var Errors; })(Base); var r1arg1; var r1arg2; - var r1 = foo2(r1arg1); + var r1 = foo2(r1arg1);// any var r1a = [r1arg2, r1arg1]; var r1b = [r1arg1, r1arg2]; var r2arg1; var r2arg2; - var r2 = foo7(r2arg1); + var r2 = foo7(r2arg1);// any var r2a = [r2arg2, r2arg1]; var r2b = [r2arg1, r2arg2]; var r3arg1; var r3arg2; - var r3 = foo8(r3arg1); + var r3 = foo8(r3arg1);// any var r3a = [r3arg2, r3arg1]; var r3b = [r3arg1, r3arg2]; var r4arg1; var r4arg2; - var r4 = foo10(r4arg1); + var r4 = foo10(r4arg1);// any var r4a = [r4arg2, r4arg1]; var r4b = [r4arg1, r4arg2]; var r5arg1; var r5arg2; - var r5 = foo11(r5arg1); + var r5 = foo11(r5arg1);// any var r5a = [r5arg2, r5arg1]; var r5b = [r5arg1, r5arg2]; var r6arg1; var r6arg2; - var r6 = foo12(r6arg1); + var r6 = foo12(r6arg1);// new (x: Array, y: Array) => Array var r6a = [r6arg2, r6arg1]; var r6b = [r6arg1, r6arg2]; var r7arg1; var r7arg2; - var r7 = foo15(r7arg1); + var r7 = foo15(r7arg1);// (x: { a: string; b: number }) => number): number; var r7a = [r7arg2, r7arg1]; var r7b = [r7arg1, r7arg2]; var r7arg3; - var r7c = foo15(r7arg3); + var r7c = foo15(r7arg3);// any var r7d = [r7arg2, r7arg3]; var r7e = [r7arg3, r7arg2]; var r8arg; - var r8 = foo16(r8arg); + var r8 = foo16(r8arg);// any var r9arg; - var r9 = foo17(r9arg); + var r9 = foo17(r9arg);// // (x: { (a: T): T; (a: T): T; }): any[]; (x: { (a: T): T; (a: T): T; }): any[]; })(Errors || (Errors = {})); var WithGenericSignaturesInBaseType; (function (WithGenericSignaturesInBaseType) { var r2arg2; - var r2 = foo2(r2arg2); + var r2 = foo2(r2arg2);// (x:T) => T[] since we can infer from generic signatures now var r3arg2; - var r3 = foo3(r3arg2); + var r3 = foo3(r3arg2);// any })(WithGenericSignaturesInBaseType || (WithGenericSignaturesInBaseType = {})); diff --git a/tests/baselines/reference/subtypingWithObjectMembersOptionality2.js b/tests/baselines/reference/subtypingWithObjectMembersOptionality2.js index 6430fe5da62..74ea8419658 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersOptionality2.js +++ b/tests/baselines/reference/subtypingWithObjectMembersOptionality2.js @@ -37,4 +37,4 @@ var r = true ? a : b; // error // object literal case var a; var b; -var r = true ? a : b; +var r = true ? a : b;// error diff --git a/tests/baselines/reference/subtypingWithObjectMembersOptionality3.js b/tests/baselines/reference/subtypingWithObjectMembersOptionality3.js index ce3acd6911b..0d301df071a 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersOptionality3.js +++ b/tests/baselines/reference/subtypingWithObjectMembersOptionality3.js @@ -37,4 +37,4 @@ var r = true ? a : b; // ok // object literal case var a; var b; -var r = true ? a : b; +var r = true ? a : b;// ok diff --git a/tests/baselines/reference/subtypingWithObjectMembersOptionality4.js b/tests/baselines/reference/subtypingWithObjectMembersOptionality4.js index 90d4a247d3e..e6e14ae04d8 100644 --- a/tests/baselines/reference/subtypingWithObjectMembersOptionality4.js +++ b/tests/baselines/reference/subtypingWithObjectMembersOptionality4.js @@ -37,4 +37,4 @@ var r = true ? a : b; // ok // object literal case var a; var b; -var r = true ? a : b; +var r = true ? a : b;// ok diff --git a/tests/baselines/reference/subtypingWithOptionalProperties.js b/tests/baselines/reference/subtypingWithOptionalProperties.js index c4dfcd2b33e..40a2defdda4 100644 --- a/tests/baselines/reference/subtypingWithOptionalProperties.js +++ b/tests/baselines/reference/subtypingWithOptionalProperties.js @@ -17,5 +17,5 @@ function f(a) { var b = a; return b; } -var r = f({ s: new Object() }); +var r = f({ s: new Object() });// ok r.s && r.s.toFixed(); diff --git a/tests/baselines/reference/superAccess.js b/tests/baselines/reference/superAccess.js index 70d3cbce619..5d0e858594a 100644 --- a/tests/baselines/reference/superAccess.js +++ b/tests/baselines/reference/superAccess.js @@ -34,9 +34,9 @@ var MyDerived = (function (_super) { _super.apply(this, arguments); } MyDerived.prototype.foo = function () { - var l3 = _super.prototype.S1; - var l4 = _super.prototype.S2; - var l5 = _super.prototype.f.call(this); + var l3 = _super.prototype.S1;// Expected => Error: Only public instance methods of the base class are accessible via the 'super' keyword + var l4 = _super.prototype.S2;// Expected => Error: Only public instance methods of the base class are accessible via the 'super' keyword + var l5 = _super.prototype.f.call(this);// Expected => Error: Only public instance methods of the base class are accessible via the 'super' keyword }; return MyDerived; })(MyBase); diff --git a/tests/baselines/reference/superCallAssignResult.js b/tests/baselines/reference/superCallAssignResult.js index 7ab5e7e069d..f1efa58befd 100644 --- a/tests/baselines/reference/superCallAssignResult.js +++ b/tests/baselines/reference/superCallAssignResult.js @@ -25,7 +25,7 @@ var E = (function () { var H = (function (_super) { __extends(H, _super); function H() { - var x = _super.call(this, 5); + var x = _super.call(this, 5);// Should be of type void, not E. x = 5; } return H; diff --git a/tests/baselines/reference/targetTypeBaseCalls.js b/tests/baselines/reference/targetTypeBaseCalls.js index 59c09aa7ea3..cf076fd78cd 100644 --- a/tests/baselines/reference/targetTypeBaseCalls.js +++ b/tests/baselines/reference/targetTypeBaseCalls.js @@ -46,4 +46,4 @@ var Bar = (function (_super) { }); } return Bar; -})(Foo); +})(Foo);// error, if types are applied correctly diff --git a/tests/baselines/reference/targetTypeCalls.js b/tests/baselines/reference/targetTypeCalls.js index b0f3e13b35f..be383e56065 100644 --- a/tests/baselines/reference/targetTypeCalls.js +++ b/tests/baselines/reference/targetTypeCalls.js @@ -10,23 +10,23 @@ var fra1 = function () { return function (v) { return v; }; -}(); +}()// should work ;// should work var fra2 = function () { return function () { return 0; }; -}(); +}()// should work ;// should work var fra3 = function () { return function () { return function (v) { return v; }; }(); -}(); +}()// should work ;// should work var fra4 = function () { return function () { return function (v) { return v; }; }(); -}(); +}()// should work ;// should work diff --git a/tests/baselines/reference/targetTypeTest3.js b/tests/baselines/reference/targetTypeTest3.js index 762d814249c..887ff87efb1 100644 --- a/tests/baselines/reference/targetTypeTest3.js +++ b/tests/baselines/reference/targetTypeTest3.js @@ -13,7 +13,7 @@ function func2(stuff1:string, stuff2:number, stuff3:number) { //// [targetTypeTest3.js] // Test target typing for array literals and call expressions -var a = [1, 2, "3"]; +var a = [1, 2, "3"];// should produce an error function func1(stuff) { return stuff; } diff --git a/tests/baselines/reference/thisInInnerFunctions.js b/tests/baselines/reference/thisInInnerFunctions.js index bce69506a91..152203027bd 100644 --- a/tests/baselines/reference/thisInInnerFunctions.js +++ b/tests/baselines/reference/thisInInnerFunctions.js @@ -26,7 +26,7 @@ var Foo = (function () { function inner() { var _this = this; this.y = "hi"; - var f = function () { return _this.y; }; + var f = function () { return _this.y; };// 'this' should be not type to 'Foo' either } }; return Foo; diff --git a/tests/baselines/reference/thisInLambda.js b/tests/baselines/reference/thisInLambda.js index 772e97562ed..217b4698b8d 100644 --- a/tests/baselines/reference/thisInLambda.js +++ b/tests/baselines/reference/thisInLambda.js @@ -26,7 +26,7 @@ var Foo = (function () { Foo.prototype.bar = function () { var _this = this; this.x; - var f = function () { return _this.x; }; + var f = function () { return _this.x; };// 'this' should be type 'Foo' as well }; return Foo; })(); diff --git a/tests/baselines/reference/thisInOuterClassBody.js b/tests/baselines/reference/thisInOuterClassBody.js index 4a8a881bd0e..05b3d535cc8 100644 --- a/tests/baselines/reference/thisInOuterClassBody.js +++ b/tests/baselines/reference/thisInOuterClassBody.js @@ -28,7 +28,7 @@ var Foo = (function () { Foo.prototype.bar = function () { var _this = this; this.x; - var f = function () { return _this.x; }; + var f = function () { return _this.x; };// 'this' should be type 'Foo' as well var p = this.y; return this; }; diff --git a/tests/baselines/reference/this_inside-enum-should-not-be-allowed.js b/tests/baselines/reference/this_inside-enum-should-not-be-allowed.js index bb4940eea4f..4fd788b902f 100644 --- a/tests/baselines/reference/this_inside-enum-should-not-be-allowed.js +++ b/tests/baselines/reference/this_inside-enum-should-not-be-allowed.js @@ -12,12 +12,12 @@ module ModuleEnum { //// [this_inside-enum-should-not-be-allowed.js] var TopLevelEnum; (function (TopLevelEnum) { - TopLevelEnum[TopLevelEnum["ThisWasAllowedButShouldNotBe"] = this] = "ThisWasAllowedButShouldNotBe"; + TopLevelEnum[TopLevelEnum["ThisWasAllowedButShouldNotBe"] = this] = "ThisWasAllowedButShouldNotBe";// Should not be allowed })(TopLevelEnum || (TopLevelEnum = {})); var ModuleEnum; (function (ModuleEnum) { var EnumInModule; (function (EnumInModule) { - EnumInModule[EnumInModule["WasADifferentError"] = this] = "WasADifferentError"; + EnumInModule[EnumInModule["WasADifferentError"] = this] = "WasADifferentError";// this was handled as if this was in a module })(EnumInModule || (EnumInModule = {})); })(ModuleEnum || (ModuleEnum = {})); diff --git a/tests/baselines/reference/topLevelModuleDeclarationAndFile.js b/tests/baselines/reference/topLevelModuleDeclarationAndFile.js index 2215b7fd0ab..5c7a0b8398f 100644 --- a/tests/baselines/reference/topLevelModuleDeclarationAndFile.js +++ b/tests/baselines/reference/topLevelModuleDeclarationAndFile.js @@ -22,5 +22,5 @@ exports.x = 42; //// [foo_2.js] /// var foo = require("vs/foo_0"); -var z1 = foo.x + 10; -var z2 = foo.y() + 10; +var z1 = foo.x + 10;// Should error, as declaration should win +var z2 = foo.y() + 10;// Should resolve diff --git a/tests/baselines/reference/twoInterfacesDifferentRootModule.js b/tests/baselines/reference/twoInterfacesDifferentRootModule.js index 893aa143e89..2f0bea69aaf 100644 --- a/tests/baselines/reference/twoInterfacesDifferentRootModule.js +++ b/tests/baselines/reference/twoInterfacesDifferentRootModule.js @@ -33,9 +33,9 @@ module M2 { var M2; (function (M2) { var a; - var r1 = a.foo; + var r1 = a.foo;// error var r2 = a.bar; var b; - var r3 = b.foo; + var r3 = b.foo;// error var r4 = b.bar; })(M2 || (M2 = {})); diff --git a/tests/baselines/reference/twoInterfacesDifferentRootModule2.js b/tests/baselines/reference/twoInterfacesDifferentRootModule2.js index 7eb4fd19903..3776cd81db9 100644 --- a/tests/baselines/reference/twoInterfacesDifferentRootModule2.js +++ b/tests/baselines/reference/twoInterfacesDifferentRootModule2.js @@ -44,16 +44,16 @@ var M; var M2; (function (M2) { var a; - var r1 = a.foo; + var r1 = a.foo;// error var r2 = a.bar; var b; - var r3 = b.foo; + var r3 = b.foo;// error var r4 = b.bar; })(M2 || (M2 = {})); var a; var r1 = a.foo; - var r2 = a.bar; + var r2 = a.bar;// error var b; var r3 = b.foo; - var r4 = b.bar; + var r4 = b.bar;// error })(M || (M = {})); diff --git a/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.js b/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.js index b6b32fb70a1..eb7f9451a71 100644 --- a/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.js +++ b/tests/baselines/reference/twoMergedInterfacesWithDifferingOverloads.js @@ -52,8 +52,8 @@ var r3 = d.foo(1, 1); // boolean, last definition wins //// [twoMergedInterfacesWithDifferingOverloads.js] var b; -var r = b.foo(true); +var r = b.foo(true);// returns Date var c; -var r2 = c.foo(1, 2); +var r2 = c.foo(1, 2);// number var d; -var r3 = d.foo(1, 1); +var r3 = d.foo(1, 1);// boolean, last definition wins diff --git a/tests/baselines/reference/typeArgInference2.js b/tests/baselines/reference/typeArgInference2.js index 9ef5987442e..f5ca6bfa4f5 100644 --- a/tests/baselines/reference/typeArgInference2.js +++ b/tests/baselines/reference/typeArgInference2.js @@ -13,9 +13,9 @@ var z5 = foo({ name: "abc", a: 5 }); // { name: string; a: number } var z6 = foo({ name: "abc", a: 5 }, { name: "def", b: 5 }); // Item //// [typeArgInference2.js] -var z1 = foo(null); -var z2 = foo(); -var z3 = foo({ name: null }); -var z4 = foo({ name: "abc" }); -var z5 = foo({ name: "abc", a: 5 }); -var z6 = foo({ name: "abc", a: 5 }, { name: "def", b: 5 }); +var z1 = foo(null);// any +var z2 = foo();// Item +var z3 = foo({ name: null });// { name: any } +var z4 = foo({ name: "abc" });// { name: string } +var z5 = foo({ name: "abc", a: 5 });// { name: string; a: number } +var z6 = foo({ name: "abc", a: 5 }, { name: "def", b: 5 });// Item diff --git a/tests/baselines/reference/typeArgInference2WithError.js b/tests/baselines/reference/typeArgInference2WithError.js index 72fa35e7fe9..4e3c0335264 100644 --- a/tests/baselines/reference/typeArgInference2WithError.js +++ b/tests/baselines/reference/typeArgInference2WithError.js @@ -8,4 +8,4 @@ declare function foo(x?: T, y?: T): T; var z7 = foo("abc", 5); // Error //// [typeArgInference2WithError.js] -var z7 = foo("abc", 5); +var z7 = foo("abc", 5);// Error diff --git a/tests/baselines/reference/typeArgumentInferenceOrdering.js b/tests/baselines/reference/typeArgumentInferenceOrdering.js index 5f5d566aadf..fb74f605bc9 100644 --- a/tests/baselines/reference/typeArgumentInferenceOrdering.js +++ b/tests/baselines/reference/typeArgumentInferenceOrdering.js @@ -19,7 +19,7 @@ interface Goo { function foo(f) { return null; } -var x = foo(new C()).x; +var x = foo(new C()).x;// was Error that property x does not exist on type {} var C = (function () { function C() { } diff --git a/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.js b/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.js index 3043a247d1f..9f9d3336f04 100644 --- a/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.js +++ b/tests/baselines/reference/typeArgumentInferenceTransitiveConstraints.js @@ -13,4 +13,4 @@ function fn(a, b, c) { return [a, b, c]; } var d = fn(new Date(), new Date(), new Date()); -var d; +var d;// Should be OK (d should be Date[]) diff --git a/tests/baselines/reference/typeArgumentInferenceWithConstraints.js b/tests/baselines/reference/typeArgumentInferenceWithConstraints.js index cfa8ef38295..1eb38fc07c6 100644 --- a/tests/baselines/reference/typeArgumentInferenceWithConstraints.js +++ b/tests/baselines/reference/typeArgumentInferenceWithConstraints.js @@ -173,7 +173,7 @@ someGenerics7(function (n) { return n; }, function (n) { return n; }, function ( function someGenerics8(n) { return n; } -var x = someGenerics8(someGenerics7); +var x = someGenerics8(someGenerics7);// Error x(null, null, null); // Generic call with multiple parameters of generic type passed arguments with no best common type function someGenerics9(a, b, c) { diff --git a/tests/baselines/reference/typeArgumentsShouldDisallowNonGenericOverloads.js b/tests/baselines/reference/typeArgumentsShouldDisallowNonGenericOverloads.js index 03786b4d1d1..ad2c4f01825 100644 --- a/tests/baselines/reference/typeArgumentsShouldDisallowNonGenericOverloads.js +++ b/tests/baselines/reference/typeArgumentsShouldDisallowNonGenericOverloads.js @@ -15,7 +15,7 @@ var z: number = foo("hi"); // should error function foo(a) { return "hi"; } -var x = foo("hi"); -var y = foo("hi"); -var w = foo("hi"); -var z = foo("hi"); +var x = foo("hi");// return type should be 'number' +var y = foo("hi");// return type should be 'string' +var w = foo("hi");// should error +var z = foo("hi");// should error diff --git a/tests/baselines/reference/typeConstraintsWithConstructSignatures.js b/tests/baselines/reference/typeConstraintsWithConstructSignatures.js index 96f56339262..bbaa57e9594 100644 --- a/tests/baselines/reference/typeConstraintsWithConstructSignatures.js +++ b/tests/baselines/reference/typeConstraintsWithConstructSignatures.js @@ -19,8 +19,8 @@ var C = (function () { this.data2 = data2; } C.prototype.create = function () { - var x = new this.data(); - var x2 = new this.data2(); + var x = new this.data();// should not error + var x2 = new this.data2();// should not error }; return C; })(); diff --git a/tests/baselines/reference/typeOfEnumAndVarRedeclarations.js b/tests/baselines/reference/typeOfEnumAndVarRedeclarations.js index 8eb669ddafd..e5d45aee948 100644 --- a/tests/baselines/reference/typeOfEnumAndVarRedeclarations.js +++ b/tests/baselines/reference/typeOfEnumAndVarRedeclarations.js @@ -20,6 +20,6 @@ var E; E[E["b"] = 1] = "b"; })(E || (E = {})); var x = E; -var x; +var x;// Shouldnt error var y = E; -var y; +var y// two errors: the types are not identical and duplicate signatures ;// two errors: the types are not identical and duplicate signatures diff --git a/tests/baselines/reference/typeOfThisInStaticMembers2.js b/tests/baselines/reference/typeOfThisInStaticMembers2.js index 255436783a1..25b51210b53 100644 --- a/tests/baselines/reference/typeOfThisInStaticMembers2.js +++ b/tests/baselines/reference/typeOfThisInStaticMembers2.js @@ -11,12 +11,12 @@ class C2 { var C = (function () { function C() { } - C.foo = this; + C.foo = this;// error return C; })(); var C2 = (function () { function C2() { } - C2.foo = this; + C2.foo = this;// error return C2; })(); diff --git a/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.js b/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.js index 32a49dc8167..5c90057a262 100644 --- a/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.js +++ b/tests/baselines/reference/typeParameterAsTypeParameterConstraint2.js @@ -23,14 +23,14 @@ foo2([], ['']); // these should be errors unless otherwise noted function foo(x, y) { return y; -} +}// this is now an error foo(1, ''); foo(1, {}); var n; var r3 = foo(1, n); function foo2(x, y) { return y; -} +}// this is now an error foo2(1, { length: '' }); foo2(1, { length: {} }); foo2([], ['']); diff --git a/tests/baselines/reference/typeParameterConstrainedToOuterTypeParameter.js b/tests/baselines/reference/typeParameterConstrainedToOuterTypeParameter.js index ccb0051db9a..91fa6b2cff1 100644 --- a/tests/baselines/reference/typeParameterConstrainedToOuterTypeParameter.js +++ b/tests/baselines/reference/typeParameterConstrainedToOuterTypeParameter.js @@ -12,4 +12,4 @@ var b: B = a; // assignment should be legal (both U's get instantiated t //// [typeParameterConstrainedToOuterTypeParameter.js] var a; -var b = a; +var b = a;// assignment should be legal (both U's get instantiated to any for comparison) diff --git a/tests/baselines/reference/typecheckIfCondition.js b/tests/baselines/reference/typecheckIfCondition.js index b6d4ef5fdc5..6d395a60b87 100644 --- a/tests/baselines/reference/typecheckIfCondition.js +++ b/tests/baselines/reference/typecheckIfCondition.js @@ -12,5 +12,5 @@ function myWrapper() function myWrapper() { if (!module.exports) module.exports = ""; - var x = null; + var x = null;// don't want to baseline output } diff --git a/tests/baselines/reference/typeofInObjectLiteralType.js b/tests/baselines/reference/typeofInObjectLiteralType.js index 401a59fb6b4..7f2cabc986d 100644 --- a/tests/baselines/reference/typeofInObjectLiteralType.js +++ b/tests/baselines/reference/typeofInObjectLiteralType.js @@ -2,4 +2,4 @@ var a: { b: number; c: typeof b }; // Should give error for attempting to use type query on b. //// [typeofInObjectLiteralType.js] -var a; +var a;// Should give error for attempting to use type query on b. diff --git a/tests/baselines/reference/typeofInternalModules.js b/tests/baselines/reference/typeofInternalModules.js index 9a4550b909f..2a62b558286 100644 --- a/tests/baselines/reference/typeofInternalModules.js +++ b/tests/baselines/reference/typeofInternalModules.js @@ -40,7 +40,7 @@ var Outer; var importInst = Outer.instantiated; var x1 = importInst.C; var x2 = new x1(); -var x3; +var x3;// Error again var x4 = Outer; var x5; x5 = Outer; diff --git a/tests/baselines/reference/typeofProperty.js b/tests/baselines/reference/typeofProperty.js index 8b621f0ae2e..7972c04316b 100644 --- a/tests/baselines/reference/typeofProperty.js +++ b/tests/baselines/reference/typeofProperty.js @@ -71,5 +71,5 @@ var ValidClass = (function () { })(); var vcInstance = new ValidClass(); var viInstance = vcInstance; -var x1; -var x2; +var x1;// x1: string +var x2;// x2: string diff --git a/tests/baselines/reference/typeofSimple.js b/tests/baselines/reference/typeofSimple.js index bd3e7512461..c4a8ecdb216 100644 --- a/tests/baselines/reference/typeofSimple.js +++ b/tests/baselines/reference/typeofSimple.js @@ -15,8 +15,8 @@ numberI = fun(); //// [typeofSimple.js] var v = 3; var v2; -var v3 = v2; -var numberJ; +var v3 = v2;// Not assignment compatible +var numberJ;//Error, cannot reference type in typeof var numberI; var fun; numberI = fun(); diff --git a/tests/baselines/reference/typeofUndefined.js b/tests/baselines/reference/typeofUndefined.js index 4f27c85ebcf..e2197c35530 100644 --- a/tests/baselines/reference/typeofUndefined.js +++ b/tests/baselines/reference/typeofUndefined.js @@ -5,7 +5,7 @@ var x: any; // shouldn't be an error since type is the same as the first declara //// [typeofUndefined.js] var x; -var x; +var x;// shouldn't be an error since type is the same as the first declaration //// [typeofUndefined.d.ts] diff --git a/tests/baselines/reference/unaryPlus.js b/tests/baselines/reference/unaryPlus.js index 35e6e28693b..8bd982e09f4 100644 --- a/tests/baselines/reference/unaryPlus.js +++ b/tests/baselines/reference/unaryPlus.js @@ -23,6 +23,6 @@ var E; ; var c = +0 /* some */; // also allowed, used to be errors -var x = +"3"; -var y = -"3"; -var z = ~"3"; +var x = +"3";//should be valid +var y = -"3";// should be valid +var z = ~"3";// should be valid diff --git a/tests/baselines/reference/undefinedInferentialTyping.js b/tests/baselines/reference/undefinedInferentialTyping.js index 0a094eea635..5556700863d 100644 --- a/tests/baselines/reference/undefinedInferentialTyping.js +++ b/tests/baselines/reference/undefinedInferentialTyping.js @@ -9,4 +9,4 @@ var a = f([], 3); // should be number function f(arr, elemnt) { return null; } -var a = f([], 3); +var a = f([], 3);// should be number diff --git a/tests/baselines/reference/unknownSymbols1.js b/tests/baselines/reference/unknownSymbols1.js index 55aa9b92cb5..62000053faf 100644 --- a/tests/baselines/reference/unknownSymbols1.js +++ b/tests/baselines/reference/unknownSymbols1.js @@ -46,7 +46,7 @@ function foo(x, y) { function foo2() { return asdf; } -var z = x; +var z = x;// should be an error var C = (function () { function C() { } @@ -69,7 +69,7 @@ var C4 = (function (_super) { } return C4; })(C3); -var x2 = this.asdf; +var x2 = this.asdf;// no error, this is any var C5 = (function () { function C5() { this.asdf = asdf; diff --git a/tests/baselines/reference/unknownSymbols2.js b/tests/baselines/reference/unknownSymbols2.js index f4cb3c45dec..930bdc8d373 100644 --- a/tests/baselines/reference/unknownSymbols2.js +++ b/tests/baselines/reference/unknownSymbols2.js @@ -35,7 +35,7 @@ var M; (function (M) { var x; var y = x + asdf; - var z = x; + var z = x;// should be an error if (asdf) { } else if (qwerty) { diff --git a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js index 76f37755898..c686a7276d7 100644 --- a/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js +++ b/tests/baselines/reference/untypedFunctionCallsWithTypeParameters1.js @@ -58,7 +58,7 @@ var r1 = x(); var y = x; var r2 = y(); var c; -var r3 = c(); +var r3 = c();// should be an error var C = (function () { function C() { this.prototype = null; @@ -70,18 +70,18 @@ var C = (function () { return C; })(); var c2; -var r4 = c2(); +var r4 = c2();// should be an error var C2 = (function (_super) { __extends(C2, _super); function C2() { _super.apply(this, arguments); } return C2; -})(Function); +})(Function);// error var c3; -var r5 = c3(); +var r5 = c3();// error var z; -var r6 = z(1); +var r6 = z(1);// error var c4; c4(1); var c5; diff --git a/tests/baselines/reference/varNameConflictsWithImportInDifferentPartOfModule.js b/tests/baselines/reference/varNameConflictsWithImportInDifferentPartOfModule.js index 4c96327e807..8e98e05de55 100644 --- a/tests/baselines/reference/varNameConflictsWithImportInDifferentPartOfModule.js +++ b/tests/baselines/reference/varNameConflictsWithImportInDifferentPartOfModule.js @@ -15,5 +15,5 @@ var M1; })(M1 || (M1 = {})); var M1; (function (M1) { - M1.q = M1.s; + M1.q = M1.s;// Should be an error but isn't })(M1 || (M1 = {})); diff --git a/tests/baselines/reference/voidArrayLit.js b/tests/baselines/reference/voidArrayLit.js index a7b9b37e88c..033cc2b5c40 100644 --- a/tests/baselines/reference/voidArrayLit.js +++ b/tests/baselines/reference/voidArrayLit.js @@ -7,7 +7,7 @@ foo((()=>{})()); // error //// [voidArrayLit.js] var va = [(function () { -})()]; +})()];// ok (function () { })(); function foo(s) { diff --git a/tests/baselines/reference/voidFunctionAssignmentCompat.js b/tests/baselines/reference/voidFunctionAssignmentCompat.js index 9a01d2e9587..53d9712b5a0 100644 --- a/tests/baselines/reference/voidFunctionAssignmentCompat.js +++ b/tests/baselines/reference/voidFunctionAssignmentCompat.js @@ -24,12 +24,12 @@ var fa = function () { return 3; }; fa = function () { -}; +}// should not work ; var fv = function () { }; fv = function () { return 0; -}; +}// should work ; function execAny(callback) { return callback(0); } @@ -44,19 +44,19 @@ execVoid(function () { var fra = function () { return function () { }; -}; +}// should work // should work ;// should work var frv = function () { return function () { return 0; }; -}; +}// should work // should work ;// should work var fra3 = (function () { return function (v) { return v; }; -})(); +})()// should work ;// should work var frv3 = (function () { return function () { return 0; }; -})(); +})()// should work ;// should work diff --git a/tests/baselines/reference/widenToAny1.js b/tests/baselines/reference/widenToAny1.js index 3225163e33b..0676186eb11 100644 --- a/tests/baselines/reference/widenToAny1.js +++ b/tests/baselines/reference/widenToAny1.js @@ -10,4 +10,4 @@ var z1: number = foo1({ x: undefined, y: "def" }); // Best common type is any function foo1(f1) { return undefined; } -var z1 = foo1({ x: undefined, y: "def" }); +var z1 = foo1({ x: undefined, y: "def" });// Best common type is any diff --git a/tests/baselines/reference/widenToAny2.js b/tests/baselines/reference/widenToAny2.js index 7ec5d93f0c0..2d8185371c3 100644 --- a/tests/baselines/reference/widenToAny2.js +++ b/tests/baselines/reference/widenToAny2.js @@ -9,4 +9,4 @@ var z3:number = foo3([undefined, "def"]); // Type is any, but should be string function foo3(x) { return undefined; } -var z3 = foo3([undefined, "def"]); +var z3 = foo3([undefined, "def"]);// Type is any, but should be string diff --git a/tests/baselines/reference/widenedTypes.js b/tests/baselines/reference/widenedTypes.js index ac97daa1136..6e77399b899 100644 --- a/tests/baselines/reference/widenedTypes.js +++ b/tests/baselines/reference/widenedTypes.js @@ -41,5 +41,5 @@ var u = [3, (y = null)]; u[3] = ""; var ob = { x: "" }; // Highlights the difference between array literals and object literals -var arr = [3, null]; -var obj = { x: 3, y: null }; +var arr = [3, null];// not assignable because null is not widened. BCT is {} +var obj = { x: 3, y: null };// assignable because null is widened, and therefore BCT is any diff --git a/tests/baselines/reference/witness.js b/tests/baselines/reference/witness.js index 51245096216..ccd1cdc68a7 100644 --- a/tests/baselines/reference/witness.js +++ b/tests/baselines/reference/witness.js @@ -142,7 +142,7 @@ var qq: any; //// [witness.js] // Initializers -var varInit = varInit; +var varInit = varInit;// any var pInit; function fn(pInit) { if (pInit === void 0) { pInit = pInit; } @@ -217,7 +217,7 @@ function overload1() { function fnArg2() { return overload1(fnArg2); } -var t = fnArg2(); +var t = fnArg2();// t: should be 'any', but is 'string' // New operator var C = (function () { function C() { @@ -238,7 +238,7 @@ function fn5() { var a; return new a(fn5); } -var fn5r = fn5(); +var fn5r = fn5();// fn5r: should be 'any', but is 'number' // Property access var propAcc1 = { m: propAcc1.m @@ -254,7 +254,7 @@ var M2; // Property access of class instance type var C2 = (function () { function C2() { - this.n = this.n; + this.n = this.n;// n: any } return C2; })(); diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints2.js b/tests/baselines/reference/wrappedAndRecursiveConstraints2.js index 5c4b65f7273..639783625b2 100644 --- a/tests/baselines/reference/wrappedAndRecursiveConstraints2.js +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints2.js @@ -13,4 +13,4 @@ var C = (function () { return C; })(); var c = new C(1); -var c = new C(new C('')); +var c = new C(new C(''));// error diff --git a/tests/baselines/reference/wrappedAndRecursiveConstraints4.js b/tests/baselines/reference/wrappedAndRecursiveConstraints4.js index 4e7a329bdb1..cd9b5635ad3 100644 --- a/tests/baselines/reference/wrappedAndRecursiveConstraints4.js +++ b/tests/baselines/reference/wrappedAndRecursiveConstraints4.js @@ -29,4 +29,4 @@ var c = new C({ length: 2 }); var r = c.foo(''); var r2 = r({ length: 3, charAt: function (x) { ''; -} }); +} });// error