Trailing comment tests for parameters, fixes the trailing // comments and parameter indentation

This commit is contained in:
Sheetal Nandi
2014-08-15 13:18:54 -07:00
parent 1b64519d52
commit 3dd21fc3a7
391 changed files with 1600 additions and 1565 deletions

View File

@@ -1204,13 +1204,13 @@ module ts {
}
function emitSignatureParameters(node: FunctionDeclaration) {
increaseIndent();
write("(");
if (node) {
increaseIndent();
emitCommaList(node.parameters, node.parameters.length - (hasRestParameters(node) ? 1 : 0));
decreaseIndent();
}
write(")");
decreaseIndent();
}
function emitSignatureAndBody(node: FunctionDeclaration) {
@@ -1386,8 +1386,8 @@ module ts {
write("function ");
emitSignatureAndBody(accessors.getAccessor);
emitEnd(accessors.getAccessor);
write(",");
emitTrailingComments(accessors.getAccessor);
write(",");
}
if (accessors.setAccessor) {
writeLine();
@@ -1397,8 +1397,8 @@ module ts {
write("function ");
emitSignatureAndBody(accessors.setAccessor);
emitEnd(accessors.setAccessor);
write(",");
emitTrailingComments(accessors.setAccessor);
write(",");
}
writeLine();
write("enumerable: true,");

View File

@@ -385,12 +385,14 @@ module ts {
continue;
case CharacterCodes.slash:
var nextChar = text.charCodeAt(pos + 1);
var hasTrailingNewLine = false;
if (nextChar === CharacterCodes.slash || nextChar === CharacterCodes.asterisk) {
var startPos = pos;
pos += 2;
if (nextChar === CharacterCodes.slash) {
while (pos < text.length) {
if (isLineBreak(text.charCodeAt(pos))) {
hasTrailingNewLine = true;
break;
}
pos++;
@@ -407,7 +409,7 @@ module ts {
}
if (collecting) {
if (!result) result = [];
result.push({ pos: startPos, end: pos });
result.push({ pos: startPos, end: pos, hasTrailingNewLine: hasTrailingNewLine });
}
continue;
}

View File

@@ -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); // unexpected error here, bug 840000
var p = new A.Point(0, 0); // unexpected error here, bug 840000

View File

@@ -30,7 +30,7 @@ var Point = (function () {
}
Point.Origin = function () {
return { x: 0, y: 0 };
}; // unexpected error here bug 840246
}; // unexpected error here bug 840246
return Point;
})();
var Point;
@@ -38,7 +38,7 @@ var Point;
function Origin() {
return null;
}
Point.Origin = Origin; //expected duplicate identifier error
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
}; // unexpected error here bug 840246
return Point;
})();
A.Point = Point;
@@ -57,7 +57,7 @@ var A;
function Origin() {
return "";
}
Point.Origin = Origin; //expected duplicate identifier error
Point.Origin = Origin; //expected duplicate identifier error
})(A.Point || (A.Point = {}));
var Point = A.Point;
})(A || (A = {}));

View File

@@ -37,7 +37,7 @@ var Point;
(function (Point) {
function Origin() {
return "";
} // not an error, since not exported
} // 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
} // not an error since not exported
})(A.Point || (A.Point = {}));
var Point = A.Point;
})(A || (A = {}));

View File

@@ -33,7 +33,7 @@ var Point = (function () {
})();
var Point;
(function (Point) {
Point.Origin = ""; //expected duplicate identifier error
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 = ""; //expected duplicate identifier error
Point.Origin = ""; //expected duplicate identifier error
})(A.Point || (A.Point = {}));
var Point = A.Point;
})(A || (A = {}));

View File

@@ -33,7 +33,7 @@ var Point = (function () {
})();
var Point;
(function (Point) {
var Origin = ""; // not an error, since not exported
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 = ""; // not an error since not exported
var Origin = ""; // not an error since not exported
})(A.Point || (A.Point = {}));
var Point = A.Point;
})(A || (A = {}));

View File

@@ -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; // error not expected here same as bug 83996 ?
var cl = X.Y.Point.Origin; // error not expected here same as bug 83996 ?
//// [simple.js]
var A = (function () {
function A() {

View File

@@ -64,7 +64,7 @@ var fn;
var fn = A.Point;
var cl;
var cl = A.Point();
var cl = A.Point.Origin; // not expected to be an error.
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; // not expected to be an error. bug 840000: [corelang] Function of fundule not assignalbe as expected
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;

View File

@@ -9,5 +9,5 @@ var x: typeof M; // Error only a namespace
//// [InvalidNonInstantiatedModule.js]
var m = M; // Error, not instantiated can not be used as var
var x; // Error only a namespace
var m = M; // Error, not instantiated can not be used as var
var x; // Error only a namespace

View File

@@ -51,7 +51,7 @@ var A;
var fn;
var fn = A.fn;
var fng;
var fng = A.fng; // bug 838015
var fng = A.fng; // bug 838015
// these should be errors since the functions are not exported
var fn2 = A.fn2;
var fng2 = A.fng2;

View File

@@ -9,6 +9,6 @@ class C1 {
var C1 = (function () {
function C1(p3) {
this.p3 = p3;
} // OK
} // OK
return C1;
})();

View File

@@ -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; // number + number is valid
var r5 = b + b; // number + number is valid
var r6 = b + c;
// object + every type except any and string
var r7 = c + a;

View File

@@ -54,18 +54,18 @@ function foo(t, u) {
var g;
var f;
// type parameter as left operand
var r1 = t + a; // ok, one operand is any
var r1 = t + a; // ok, one operand is any
var r2 = t + b;
var r3 = t + c;
var r4 = t + d; // ok, one operand is string
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; // ok, one operand is any
var r8 = a + t; // ok, one operand is any
var r9 = b + t;
var r10 = c + t;
var r11 = d + t; // ok, one operand is string
var r11 = d + t; // ok, one operand is string
var r12 = e + t;
var r13 = g + t;
var r14 = f + t;

View File

@@ -46,7 +46,7 @@ var provide = foo;
var booz = foo.bar.baz;
var p = new provide.Provide();
function use() {
var p1; // error here, but should be okay
var p1; // error here, but should be okay
var p2;
var p3;
var p22 = new provide.Provide();

View File

@@ -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"); // foo.A should be ok but foo.bar should be error
var x = foo.bar("hello"); // foo.A should be ok but foo.bar should be error

View File

@@ -90,40 +90,40 @@ var r3 = foo3(a); // any
//// [anyAssignabilityInInheritance.js]
var 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 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); // any
var r3 = foo3(a); // any
var A2 = (function () {
function A2() {
}
return A2;
})();
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 E;
(function (E) {
E[E["A"] = 0] = "A";
})(E || (E = {}));
var r3 = foo3(a); // any
var r3 = foo3(a); // any
function f() {
}
var f;
(function (f) {
f.bar = 1;
})(f || (f = {}));
var r3 = foo3(a); // any
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); // any
var r3 = foo3(a); // any
var r3 = foo3(a); // any
var r3 = foo3(a); // any
var r3 = foo3(a); // any

View File

@@ -598,9 +598,9 @@ var e;
var f;
// All of the below should be an error unless otherwise noted
// operator *
var r1a1 = a * a; //ok
var r1a1 = a * a; //ok
var r1a2 = a * b;
var r1a3 = a * c; //ok
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; //ok
var r1c1 = c * a; //ok
var r1c2 = c * b;
var r1c3 = c * c; //ok
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; //ok
var r1g1 = 0 /* a */ * a; //ok
var r1g2 = 0 /* a */ * b;
var r1g3 = 0 /* a */ * c; //ok
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 */; //ok
var r1h1 = a * 1 /* b */; //ok
var r1h2 = b * 1 /* b */;
var r1h3 = c * 1 /* b */; //ok
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; //ok
var r2a1 = a / a; //ok
var r2a2 = a / b;
var r2a3 = a / c; //ok
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; //ok
var r2c1 = c / a; //ok
var r2c2 = c / b;
var r2c3 = c / c; //ok
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; //ok
var r2g1 = 0 /* a */ / a; //ok
var r2g2 = 0 /* a */ / b;
var r2g3 = 0 /* a */ / c; //ok
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 */; //ok
var r2h1 = a / 1 /* b */; //ok
var r2h2 = b / 1 /* b */;
var r2h3 = c / 1 /* b */; //ok
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; //ok
var r3a1 = a % a; //ok
var r3a2 = a % b;
var r3a3 = a % c; //ok
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; //ok
var r3c1 = c % a; //ok
var r3c2 = c % b;
var r3c3 = c % c; //ok
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; //ok
var r3g1 = 0 /* a */ % a; //ok
var r3g2 = 0 /* a */ % b;
var r3g3 = 0 /* a */ % c; //ok
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 */; //ok
var r3h1 = a % 1 /* b */; //ok
var r3h2 = b % 1 /* b */;
var r3h3 = c % 1 /* b */; //ok
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; //ok
var r4a1 = a - a; //ok
var r4a2 = a - b;
var r4a3 = a - c; //ok
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; //ok
var r4c1 = c - a; //ok
var r4c2 = c - b;
var r4c3 = c - c; //ok
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; //ok
var r4g1 = 0 /* a */ - a; //ok
var r4g2 = 0 /* a */ - b;
var r4g3 = 0 /* a */ - c; //ok
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 */; //ok
var r4h1 = a - 1 /* b */; //ok
var r4h2 = b - 1 /* b */;
var r4h3 = c - 1 /* b */; //ok
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; //ok
var r5a1 = a << a; //ok
var r5a2 = a << b;
var r5a3 = a << c; //ok
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; //ok
var r5c1 = c << a; //ok
var r5c2 = c << b;
var r5c3 = c << c; //ok
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; //ok
var r5g1 = 0 /* a */ << a; //ok
var r5g2 = 0 /* a */ << b;
var r5g3 = 0 /* a */ << c; //ok
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 */; //ok
var r5h1 = a << 1 /* b */; //ok
var r5h2 = b << 1 /* b */;
var r5h3 = c << 1 /* b */; //ok
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; //ok
var r6a1 = a >> a; //ok
var r6a2 = a >> b;
var r6a3 = a >> c; //ok
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; //ok
var r6c1 = c >> a; //ok
var r6c2 = c >> b;
var r6c3 = c >> c; //ok
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; //ok
var r6g1 = 0 /* a */ >> a; //ok
var r6g2 = 0 /* a */ >> b;
var r6g3 = 0 /* a */ >> c; //ok
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 */; //ok
var r6h1 = a >> 1 /* b */; //ok
var r6h2 = b >> 1 /* b */;
var r6h3 = c >> 1 /* b */; //ok
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; //ok
var r7a1 = a >>> a; //ok
var r7a2 = a >>> b;
var r7a3 = a >>> c; //ok
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; //ok
var r7c1 = c >>> a; //ok
var r7c2 = c >>> b;
var r7c3 = c >>> c; //ok
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; //ok
var r7g1 = 0 /* a */ >>> a; //ok
var r7g2 = 0 /* a */ >>> b;
var r7g3 = 0 /* a */ >>> c; //ok
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 */; //ok
var r7h1 = a >>> 1 /* b */; //ok
var r7h2 = b >>> 1 /* b */;
var r7h3 = c >>> 1 /* b */; //ok
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; //ok
var r8a1 = a & a; //ok
var r8a2 = a & b;
var r8a3 = a & c; //ok
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; //ok
var r8c1 = c & a; //ok
var r8c2 = c & b;
var r8c3 = c & c; //ok
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; //ok
var r8g1 = 0 /* a */ & a; //ok
var r8g2 = 0 /* a */ & b;
var r8g3 = 0 /* a */ & c; //ok
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 */; //ok
var r8h1 = a & 1 /* b */; //ok
var r8h2 = b & 1 /* b */;
var r8h3 = c & 1 /* b */; //ok
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; //ok
var r9a1 = a ^ a; //ok
var r9a2 = a ^ b;
var r9a3 = a ^ c; //ok
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; //ok
var r9c1 = c ^ a; //ok
var r9c2 = c ^ b;
var r9c3 = c ^ c; //ok
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; //ok
var r9g1 = 0 /* a */ ^ a; //ok
var r9g2 = 0 /* a */ ^ b;
var r9g3 = 0 /* a */ ^ c; //ok
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 */; //ok
var r9h1 = a ^ 1 /* b */; //ok
var r9h2 = b ^ 1 /* b */;
var r9h3 = c ^ 1 /* b */; //ok
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; //ok
var r10a1 = a | a; //ok
var r10a2 = a | b;
var r10a3 = a | c; //ok
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; //ok
var r10c1 = c | a; //ok
var r10c2 = c | b;
var r10c3 = c | c; //ok
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; //ok
var r10g1 = 0 /* a */ | a; //ok
var r10g2 = 0 /* a */ | b;
var r10g3 = 0 /* a */ | c; //ok
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 */; //ok
var r10h1 = a | 1 /* b */; //ok
var r10h2 = b | 1 /* b */;
var r10h3 = c | 1 /* b */; //ok
var r10h3 = c | 1 /* b */; //ok
var r10h4 = d | 1 /* b */;
var r10h5 = e | 1 /* b */;
var r10h6 = f | 1 /* b */;

View File

@@ -149,10 +149,10 @@ var arr_i1_2 = [];
var arr_c1_2 = [];
var arr_c2_2 = [];
var arr_c3 = [];
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
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;

View File

@@ -11,4 +11,4 @@ var y: string[][]; // Expect no error here
//// [arrayAugment.js]
var x = [''];
var y = x.split(4);
var y; // Expect no error here
var y; // Expect no error here

View File

@@ -16,7 +16,7 @@ myCars3 = myCars5;
//// [arrayLiteralAndArrayConstructorEquivalence1.js]
var myCars = new Array();
var myCars3 = new Array({});
var myCars4; // error
var myCars4; // error
var myCars5;
myCars = myCars3;
myCars = myCars4;

View File

@@ -16,11 +16,11 @@ var c = [[[null]],[undefined]]
//// [arrayLiteralWidened.js]
// array literals are widened upon assignment according to their element type
var a = []; // any[]
var a = []; // any[]
var a = [null, null];
var a = [undefined, undefined];
var b = [[], [null, null]]; // any[][]
var b = [[], [null, null]]; // any[][]
var b = [[], []];
var b = [[undefined, undefined]];
var c = [[[]]]; // any[][][]
var c = [[[]]]; // any[][][]
var c = [[[null]], [undefined]];

View File

@@ -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]; // { 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[]
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[]

View File

@@ -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; // Bug 825172: Error ({}[] does not match {}[]), but should be OK
var arr1; // Bug 825172: Error ({}[] does not match {}[]), but should be OK
var arr2 = [[null], [1], ['']];
var arr2; // Bug 825172: Error ({}[] does not match {}[]), but should be OK
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; // Should be OK
var classArr; // Should be OK
var classTypeArray = [C, C, C];
var classTypeArray; // Should OK, not be a parse error
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; // Should be OK
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() {

View File

@@ -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]; // List<number>[]
var xs = [list, myList]; // {}[]
var ys = [list, list2]; // {}[]
var zs = [list, null]; // List<number>[]
var myDerivedList;
var as = [list, myDerivedList]; // List<number>[]

View File

@@ -43,7 +43,7 @@ var b;
var c;
var z = [a, b, c];
var r4 = z[0];
var r5 = r4(''); // any not string
var r5 = r4(''); // any not string
var r5b = r4(1);
var a2;
var b2;

View File

@@ -25,7 +25,7 @@ var r2b = new r();
var x2;
var r3 = x2[1];
var r4 = r3();
var r4b = new r3(); // error
var r4b = new r3(); // error
var x3;
var r5 = x2[1];
var r6 = r5();

View File

@@ -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; // OK
var obj; // OK
var arr = [function (n) { return ''; }];
var arr; // Incorrect error here (bug 829597)
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"; // error, can't use this in enum
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; // OK
var obj; // OK
var arr = [function (n) { return ''; }];
var arr; // Incorrect error here (bug 829597)
var arr; // Incorrect error here (bug 829597)
// Arrow function as enum value
var E;
(function (E) {
@@ -179,7 +179,7 @@ var M2;
})(M2 || (M2 = {}));
// <Identifier>(ParamList) => { ... } is a generic arrow function
var generic1 = function (n) { return [n]; };
var generic1; // Incorrect error, Bug 829597
var generic1; // Incorrect error, Bug 829597
var generic2 = function (n) {
return [n];
};

View File

@@ -13,4 +13,4 @@ var C = (function () {
})();
var c = new C(function () {
return asdf;
}); // should error
}); // should error

View File

@@ -39,7 +39,7 @@ b3 = {
}; // error
//// [assignmentCompatBug2.js]
var b2 = { a: 0 }; // error
var b2 = { a: 0 }; // error
b2 = { a: 0 };
b2 = { b: 0, a: 0 };
var b3;

View File

@@ -199,7 +199,7 @@ b15 = a15;
var b16;
a16 = b16;
b16 = a16;
var b17; // ok
var b17; // ok
a17 = b17;
b17 = a17;
var b18;

View File

@@ -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; // ok, same number of required params
var a; // ok, same number of required params
a = function () { return 1; };
a = function () {
var args = [];

View File

@@ -199,7 +199,7 @@ b15 = a15;
var b16;
a16 = b16;
b16 = a16;
var b17; // ok
var b17; // ok
a17 = b17;
b17 = a17;
var b18;

View File

@@ -6,5 +6,5 @@ var c: Object = a; // should be error
//// [assignmentToObject.js]
var a = { toString: 5 };
var b = a; // ok
var c = a; // should be error
var b = a; // ok
var c = a; // should be error

View File

@@ -30,20 +30,20 @@ module bad {
var badFundule: Function = bad; // error
//// [assignmentToObjectAndFunction.js]
var errObj = { toString: 0 }; // Error, incompatible toString
var errObj = { toString: 0 }; // Error, incompatible toString
var goodObj = {
toString: function (x) {
return "";
}
}; // Ok, because toString is a subtype of Object's toString
var errFun = {}; // Error for no call signature
}; // 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; // ok
var goodFundule = foo; // ok
function bar() {
}
var bar;
@@ -52,7 +52,7 @@ var bar;
}
bar.apply = apply;
})(bar || (bar = {}));
var goodFundule2 = bar; // ok
var goodFundule2 = bar; // ok
function bad() {
}
var bad;

View File

@@ -25,5 +25,5 @@ var v2: {
var o = {};
var f = function () {
};
var v1 = o; // Should be allowed
var v1 = o; // Should be allowed
var v2 = f; // Should be allowed

View File

@@ -14,6 +14,6 @@ var a = {}[0]; // Should be Foo
var b = (() => { })[0]; // Should be Bar
//// [augmentedTypeBracketAccessIndexSignature.js]
var a = {}[0]; // Should be Foo
var a = {}[0]; // Should be Foo
var b = (function () {
})[0]; // Should be Bar

View File

@@ -17,7 +17,7 @@ var r4 = f['data']; // Should be number
var o = {};
var f = function () {
};
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 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

View File

@@ -16,7 +16,7 @@ var c1 = (function () {
};
return c1;
})();
var c1 = 1; // error
var c1 = 1; // error
//// class then enum
var c4 = (function () {
function c4() {

View File

@@ -14,6 +14,6 @@ var c2 = (function () {
return c2;
})();
function c2() {
} // error
} // error
var c2 = function () {
};

View File

@@ -32,7 +32,7 @@ var c5a = (function () {
var c5a;
(function (c5a) {
var y = 2;
})(c5a || (c5a = {})); // should be ok
})(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 = {})); // should be ok
})(c5b || (c5b = {})); // should be ok
//// class then import
var c5c = (function () {
function c5c() {

View File

@@ -19,4 +19,4 @@ var c3 = (function () {
c3.prototype.bar = function () {
};
return c3;
})(); // error
})(); // error

View File

@@ -41,20 +41,20 @@ var e1111;
(function (e1111) {
e1111[e1111["One"] = 0] = "One";
})(e1111 || (e1111 = {}));
var e1111 = 1; // error
var e1111 = 1; // error
// enum then function
var e2;
(function (e2) {
e2[e2["One"] = 0] = "One";
})(e2 || (e2 = {}));
function e2() {
} // error
} // error
var e3;
(function (e3) {
e3[e3["One"] = 0] = "One";
})(e3 || (e3 = {}));
var e3 = function () {
}; // error
}; // error
// enum then class
var e4;
(function (e4) {
@@ -66,7 +66,7 @@ var e4 = (function () {
e4.prototype.foo = function () {
};
return e4;
})(); // error
})(); // 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 = {})); // error
})(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 = {})); // should be error
})(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 = {})); // should be error
})(e6b || (e6b = {})); // should be error

View File

@@ -42,16 +42,16 @@ module y5c { export interface I { foo(): void } } // should be an error
// function then var
function y1() {
}
var y1 = 1; // error
var y1 = 1; // error
// function then function
function y2() {
}
function y2() {
} // error
} // error
function y2a() {
}
var y2a = function () {
}; // error
}; // error
// function then class
function y3() {
}
@@ -59,7 +59,7 @@ var y3 = (function () {
function y3() {
}
return y3;
})(); // error
})(); // error
function y3a() {
}
var y3a = (function () {
@@ -68,14 +68,14 @@ var y3a = (function () {
y3a.prototype.foo = function () {
};
return y3a;
})(); // error
})(); // error
// function then enum
function y4() {
}
var y4;
(function (y4) {
y4[y4["One"] = 0] = "One";
})(y4 || (y4 = {})); // error
})(y4 || (y4 = {})); // error
// function then internal module
function y5() {
}
@@ -84,12 +84,12 @@ function y5a() {
var y5a;
(function (y5a) {
var y = 2;
})(y5a || (y5a = {})); // should be an error
})(y5a || (y5a = {})); // should be an error
function y5b() {
}
var y5b;
(function (y5b) {
y5b.y = 3;
})(y5b || (y5b = {})); // should be an error
})(y5b || (y5b = {})); // should be an error
function y5c() {
}

View File

@@ -98,7 +98,7 @@ module m6 { export var y = 2; }
//// [augmentedTypesModules.js]
var m1 = 1; // Should be allowed
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; // Should be allowed
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; // error
var m1d = 1; // error
function m2() {
}
;
@@ -168,7 +168,7 @@ var m3 = (function () {
function m3() {
}
return m3;
})(); // ok since the module is not instantiated
})(); // 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
})(); // error, class isn't ambient or declared before the module
var m3b = (function () {
function m3b() {
}

View File

@@ -11,7 +11,7 @@ var m3 = (function () {
function m3() {
}
return m3;
})(); // ok since the module is not instantiated
})(); // ok since the module is not instantiated
var m3a;
(function (m3a) {
var y = 2;

View File

@@ -43,17 +43,17 @@ var x1 = 2;
// var then function
var x2 = 1;
function x2() {
} // should be an error
} // should be an error
var x3 = 1;
var x3 = function () {
}; // should be an error
}; // should be an error
// var then class
var x4 = 1;
var x4 = (function () {
function x4() {
}
return x4;
})(); // error
})(); // error
var x4a = 1;
var x4a = (function () {
function x4a() {
@@ -61,22 +61,22 @@ var x4a = (function () {
x4a.prototype.foo = function () {
};
return x4a;
})(); // error
})(); // error
// var then enum
var x5 = 1;
var x5;
(function (x5) {
x5[x5["One"] = 0] = "One";
})(x5 || (x5 = {})); // error
})(x5 || (x5 = {})); // error
// var then module
var x6 = 1;
var x6a = 1;
var x6a;
(function (x6a) {
var y = 2;
})(x6a || (x6a = {})); // error since instantiated
})(x6a || (x6a = {})); // error since instantiated
var x6b = 1;
var x6b;
(function (x6b) {
x6b.y = 2;
})(x6b || (x6b = {})); // error
})(x6b || (x6b = {})); // error

View File

@@ -14,5 +14,5 @@ var Foo;
})(Foo || (Foo = {}));
var Foo;
(function (Foo) {
Foo[Foo["b"] = 0] = "b"; // should work fine
Foo[Foo["b"] = 0] = "b"; // should work fine
})(Foo || (Foo = {}));

View File

@@ -23,8 +23,8 @@ var N=new f(); // ok with void fn
function f() {
var x = 1;
}
var y = f(); // error void fn
var why = f(); // error void fn
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(); // error void fn
var N = new f(); // ok with void fn
var z = new C().g(); // error void fn
var N = new f(); // ok with void fn

View File

@@ -65,7 +65,7 @@ var D = (function (_super) {
this.z = z;
}
return D;
})(C); // too few params
})(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); // first param type
})(C); // first param type
function f() {
if (x < 10) {
x = 11;

View File

@@ -61,18 +61,18 @@ var derived;
var derived2;
var r = true ? 1 : 2;
var r3 = true ? 1 : {};
var r4 = true ? a : b; // typeof a
var r5 = true ? b : a; // typeof b
var r4 = true ? a : b; // typeof a
var r5 = true ? b : a; // typeof b
var r6 = true ? function (x) {
} : function (x) {
}; // returns number => void
}; // returns number => void
var r7 = true ? function (x) {
} : function (x) {
};
var r8 = true ? function (x) {
} : function (x) {
}; // returns Object => void
var r10 = true ? derived : derived2; // no error since we use the contextual type in BCT
}; // 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;

View File

@@ -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]; // Ellement[]
var obj = { s: e }; // { s: Ellement; [s: string]: Ellement }
var conditional = null ? e : e; // Ellement
var arr = [e]; // Ellement[]
var obj = { s: e }; // { s: Ellement; [s: string]: Ellement }
var conditional = null ? e : e; // Ellement
var contextualOr = e || e; // Ellement

View File

@@ -13,5 +13,5 @@ var M;
}
return C;
})();
M.C = C; // this should be an unresolved symbol I error
M.C = C; // this should be an unresolved symbol I error
})(M || (M = {}));

View File

@@ -11,6 +11,6 @@ declare class C { constructor(value: number); }
(new C(1))(); // Error for calling an instance
//// [callOnInstance.js]
var s1 = D(); // OK
var s1 = D(); // OK
var s2 = (new D(1))();
(new C(1))();

View File

@@ -38,7 +38,7 @@ function F1(s) {
}
function F1(a) {
return a;
} // error - duplicate identifier
} // error - duplicate identifier
var f1 = new Foo("hey");
f1.bar1();
Foo();

View File

@@ -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); // void since there's a body
var r = foo(1); // void since there's a body
var i;
var r2 = i();
var r3 = i.f();

View File

@@ -17,5 +17,5 @@ var r2 = x.foo(''); // error
//// [callSignaturesThatDifferOnlyByReturnType2.js]
var x;
// BUG 822524
var r = x.foo(1); // no error
var r2 = x.foo(''); // error
var r = x.foo(1); // no error
var r2 = x.foo(''); // error

View File

@@ -27,7 +27,7 @@ var rf1 = function (x) {
var r1a = _.map(c2, function (x) {
return x.toFixed();
});
var r1b = _.map(c2, rf1); // this line should not cause the following 2 to have errors
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();
});

View File

@@ -16,7 +16,7 @@ var C = (function () {
}
return C;
})();
var C = ''; // error
var C = ''; // error
var M;
(function (M) {
var D = (function () {
@@ -24,5 +24,5 @@ var M;
}
return D;
})();
var D = 1; // error
var D = 1; // error
})(M || (M = {}));

View File

@@ -18,14 +18,14 @@ var C = (function (_super) {
_super.apply(this, arguments);
}
return C;
})(C); // error
})(C); // error
var D = (function (_super) {
__extends(D, _super);
function D() {
_super.apply(this, arguments);
}
return D;
})(D); // error
})(D); // error
var E = (function (_super) {
__extends(E, _super);
function E() {

View File

@@ -24,7 +24,7 @@ var C = (function (_super) {
_super.apply(this, arguments);
}
return C;
})(E); // error
})(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); // error
})(E2); // error
var D2 = (function (_super) {
__extends(D2, _super);
function D2() {

View File

@@ -35,7 +35,7 @@ var C = (function (_super) {
_super.apply(this, arguments);
}
return C;
})(N.E); // error
})(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); // error
})(Q.E2); // error
var P;
(function (P) {
var D2 = (function (_super) {

View File

@@ -31,7 +31,7 @@ var C = (function (_super) {
_super.apply(this, arguments);
}
return C;
})(E); // error
})(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); // error
})(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];

View File

@@ -14,7 +14,7 @@ var __extends = this.__extends || function (d, b) {
};
function foo() {
}
var x = new foo(); // can be used as a constructor function
var x = new foo(); // can be used as a constructor function
var C = (function (_super) {
__extends(C, _super);
function C() {

View File

@@ -32,7 +32,7 @@ var C = (function () {
function C() {
}
return C;
})(); // error
})(); // error
var C2 = (function (_super) {
__extends(C2, _super);
function C2() {

View File

@@ -27,7 +27,7 @@ var CCC = (function () {
this.y = aaa;
this.y = '';
}
CCC.staticY = aaa; // This shouldnt be error
CCC.staticY = aaa; // This shouldnt be error
return CCC;
})();
// above is equivalent to this:

View File

@@ -46,6 +46,6 @@ var C = (function (_super) {
}
return C;
})(A);
var r1 = B; // error
var r2 = B; // error
var r1 = B; // error
var r2 = B; // error
var r3 = C; // ok

View File

@@ -60,8 +60,8 @@ var C = (function (_super) {
return C;
})(Base);
var r = C;
var c = new C(); // error
var c2 = new C(1); // ok
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(); // error
var d2 = new D(1); // ok
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(); // error
var d4 = new D(1); // ok
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(); // error
var d5 = new D(); // error
var d6 = new D(1); // ok

View File

@@ -63,16 +63,16 @@ var NonGeneric;
}
return C;
})();
var c = new C(); // error
var c2 = new C(''); // ok
var c = new C(); // error
var c2 = new C(''); // ok
var C2 = (function () {
function C2(x) {
}
return C2;
})();
var c3 = new C2(); // error
var c4 = new C2(''); // ok
var c5 = new C2(1); // ok
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(); // error
var d2 = new D(1); // ok
var d3 = new D(''); // ok
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(); // error
var c2 = new C(''); // ok
var c = new C(); // error
var c2 = new C(''); // ok
var C2 = (function () {
function C2(x) {
}
return C2;
})();
var c3 = new C2(); // error
var c4 = new C2(''); // ok
var c5 = new C2(1, 2); // ok
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(); // error
var d2 = new D(1); // ok
var d3 = new D(''); // ok
var d = new D(); // error
var d2 = new D(1); // ok
var d3 = new D(''); // ok
})(Generics || (Generics = {}));

View File

@@ -24,7 +24,7 @@ var C = (function () {
return C;
})();
var c = new C();
var c2 = new C(null); // error
var c2 = new C(null); // error
var D = (function () {
function D() {
this.x = 2;

View File

@@ -36,4 +36,4 @@ var A;
})(A.B || (A.B = {}));
var B = A.B;
})(A || (A = {}));
var b; // ok
var b; // ok

View File

@@ -43,7 +43,7 @@ var T1;
(function (m3d) {
m3d.y = 2;
})(m3d || (m3d = {}));
var r = new m3d(); // error
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(); // error
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(); // error
var r = new m3d(); // error
var r2 = new m4d(); // error

View File

@@ -22,25 +22,25 @@ var f1 = function (i) {
for (var _i = 1; _i < arguments.length; _i++) {
arguments[_i - 1] = arguments[_i];
}
var arguments; // no error
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; // no error
var arguments = 10; // no error
};
var f1NoError = function (arguments) {
var arguments = 10; // no error
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; // No Error
var arguments = 10; // No Error
};
var f2NoError = function () {
var arguments = 10; // no error
var arguments = 10; // no error
};

View File

@@ -94,7 +94,7 @@ var c1 = (function () {
for (var _i = 1; _i < arguments.length; _i++) {
arguments[_i - 1] = arguments[_i];
}
var arguments; // no error
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; // no error
var arguments = 10; // no error
}
return c12;
})();
var c1NoError = (function () {
function c1NoError(arguments) {
var arguments = 10; // no error
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; // no error
var arguments = 10; // no error
}
return c2;
})();
var c2NoError = (function () {
function c2NoError() {
var arguments = 10; // no error
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; // no error
var arguments = 10; // no error
}
return c3;
})();
var c3NoError = (function () {
function c3NoError(arguments) {
this.arguments = arguments;
var arguments = 10; // no error
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; // no error
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; // no error
var arguments; // no error
}
return c52;
})();
var c5NoError = (function () {
function c5NoError(arguments) {
var arguments; // no error
var arguments; // no error
}
return c5NoError;
})();

View File

@@ -57,34 +57,34 @@ var c1 = (function () {
for (var _i = 1; _i < arguments.length; _i++) {
arguments[_i - 1] = arguments[_i];
}
var arguments; // no error
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; // no error
var arguments = 10; // no error
};
c1.prototype.fooNoError = function (arguments) {
var arguments = 10; // no error
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; // no error
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; // no error
var arguments; // no error
};
c1.prototype.f4NoError = function (arguments) {
var arguments; // no error
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; // no error
var arguments = 10; // no error
};
c3.prototype.fooNoError = function () {
var arguments = 10; // no error
var arguments = 10; // no error
};
return c3;
})();

View File

@@ -51,42 +51,42 @@ function f1(arguments) {
for (var _i = 1; _i < arguments.length; _i++) {
restParameters[_i - 1] = arguments[_i];
}
var arguments = 10; // no error
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; // no error
var arguments; // no error
}
function f1NoError(arguments) {
var arguments = 10; // no error
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; // no error
var arguments = 10; // no error
}
function f3NoError() {
var arguments = 10; // no error
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; // No error
var arguments; // No error
}
function f42(i) {
var arguments = [];
for (var _i = 1; _i < arguments.length; _i++) {
arguments[_i - 1] = arguments[_i];
}
var arguments; // No error
var arguments; // No error
}
function f4NoError(arguments) {
var arguments; // No error
var arguments; // No error
}

View File

@@ -41,43 +41,43 @@ function foo() {
for (var _i = 1; _i < arguments.length; _i++) {
restParameters[_i - 1] = arguments[_i];
}
var arguments = 10; // no error
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; // no error
var arguments; // no error
}
function f1NoError(arguments) {
var arguments = 10; // no error
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; // no error
var arguments = 10; // no error
}
function f3NoError() {
var arguments = 10; // no error
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; // No error
var arguments; // No error
}
function f42(i) {
var arguments = [];
for (var _i = 1; _i < arguments.length; _i++) {
arguments[_i - 1] = arguments[_i];
}
var arguments; // No error
var arguments; // No error
}
function f4NoError(arguments) {
var arguments; // No error
var arguments; // No error
}
}

View File

@@ -15,7 +15,7 @@ var v21: {
}
//// [collisionArgumentsInType.js]
var v1; // no error - no code gen
var v12; // no error - no code gen
var v1; // no error - no code gen
var v12; // no error - no code gen
var v2;
var v21;

View File

@@ -19,18 +19,18 @@ var f1 = function (_i) {
for (var _i = 1; _i < arguments.length; _i++) {
restParameters[_i - 1] = arguments[_i];
}
var _i = 10; // no error
var _i = 10; // no error
};
var f1NoError = function (_i) {
var _i = 10; // no error
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; // No Error
var _i = 10; // No Error
};
var f2NoError = function () {
var _i = 10; // no error
var _i = 10; // no error
};

View File

@@ -74,13 +74,13 @@ var c1 = (function () {
for (var _i = 1; _i < arguments.length; _i++) {
restParameters[_i - 1] = arguments[_i];
}
var _i = 10; // no error
var _i = 10; // no error
}
return c1;
})();
var c1NoError = (function () {
function c1NoError(_i) {
var _i = 10; // no error
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; // no error
var _i = 10; // no error
}
return c2;
})();
var c2NoError = (function () {
function c2NoError() {
var _i = 10; // no error
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; // no error
var _i = 10; // no error
}
return c3;
})();
var c3NoError = (function () {
function c3NoError(_i) {
this._i = _i;
var _i = 10; // no error
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; // no error
var _i; // no error
}
return c5;
})();
var c5NoError = (function () {
function c5NoError(_i) {
var _i; // no error
var _i; // no error
}
return c5NoError;
})();

View File

@@ -47,20 +47,20 @@ var c1 = (function () {
for (var _i = 1; _i < arguments.length; _i++) {
restParameters[_i - 1] = arguments[_i];
}
var _i = 10; // no error
var _i = 10; // no error
};
c1.prototype.fooNoError = function (_i) {
var _i = 10; // no error
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; // no error
var _i; // no error
};
c1.prototype.f4NoError = function (_i) {
var _i; // no error
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; // no error
var _i = 10; // no error
};
c3.prototype.fooNoError = function () {
var _i = 10; // no error
var _i = 10; // no error
};
return c3;
})();

View File

@@ -40,20 +40,20 @@ function f1(_i) {
for (var _i = 1; _i < arguments.length; _i++) {
restParameters[_i - 1] = arguments[_i];
}
var _i = 10; // no error
var _i = 10; // no error
}
function f1NoError(_i) {
var _i = 10; // no error
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; // no error
var _i = 10; // no error
}
function f3NoError() {
var _i = 10; // no error
var _i = 10; // no error
}
function f4(_i) {
var rest = [];

View File

@@ -31,20 +31,20 @@ function foo() {
for (var _i = 1; _i < arguments.length; _i++) {
restParameters[_i - 1] = arguments[_i];
}
var _i = 10; // no error
var _i = 10; // no error
}
function f1NoError(_i) {
var _i = 10; // no error
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; // no error
var _i = 10; // no error
}
function f3NoError() {
var _i = 10; // no error
var _i = 10; // no error
}
function f4(_i) {
var rest = [];

View File

@@ -8,5 +8,5 @@ var v2: {
}
//// [collisionRestParameterInType.js]
var v1; // no error - no code gen
var v1; // no error - no code gen
var v2;

View File

@@ -27,10 +27,10 @@ var __extends = this.__extends || function (d, b) {
__.prototype = b.prototype;
d.prototype = new __();
};
var _super = 10; // No Error
var _super = 10; // No Error
var Foo = (function () {
function Foo() {
var _super = 10; // No error
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; // Should be error
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; // Should be error
var _super = 10; // Should be error
};
}
return c;

View File

@@ -25,12 +25,12 @@ var __extends = this.__extends || function (d, b) {
__.prototype = b.prototype;
d.prototype = new __();
};
var _super = 10; // No Error
var _super = 10; // No Error
var Foo = (function () {
function Foo() {
}
Foo.prototype.x = function () {
var _super = 10; // No error
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; // Should be error
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; // Should be error
var _super = 10; // Should be error
};
};
return c;

View File

@@ -24,15 +24,15 @@ var __extends = this.__extends || function (d, b) {
__.prototype = b.prototype;
d.prototype = new __();
};
var _super = 10; // No Error
var _super = 10; // No Error
var Foo = (function () {
function Foo() {
this.prop1 = {
doStuff: function () {
var _super = 10; // No error
var _super = 10; // No error
}
};
this._super = 10; // No error
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; // Should be error
var _super = 10; // Should be error
}
};
this._super = 10; // No error
this._super = 10; // No error
}
return b;
})(Foo);

View File

@@ -19,7 +19,7 @@ var __extends = this.__extends || function (d, b) {
d.prototype = new __();
};
var console;
var _super = 10; // No error
var _super = 10; // No error
var base = (function () {
function base() {
}

View File

@@ -18,7 +18,7 @@ var Foo = (function () {
function Foo() {
}
Foo.prototype.x = function () {
var _this = 10; // Local var. No this capture in x(), so no conflict.
var _this = 10; // Local var. No this capture in x(), so no conflict.
function inner() {
var _this = this;
console.log(_this);

View File

@@ -98,7 +98,7 @@ var Foo = (function () {
function Foo() {
}
Foo.prototype.x = function () {
var _this = 10; // Local var. No this capture in x(), so no conflict.
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; // Local var. No this capture in x(), so no conflict.
var _this = 10; // Local var. No this capture in x(), so no conflict.
function inner(_this) {
}
};

View File

@@ -19,10 +19,10 @@ function foo1<T1, T2>() {
function foo(x, y) {
return x, y;
}
var resultIsString = foo(1, "123"); //error here
var resultIsString = foo(1, "123"); //error here
//TypeParameters
function foo1() {
var x;
var y;
var result = (x, y); //error here
var result = (x, y); //error here
}

View File

@@ -22,7 +22,18 @@ var fooFunc = function FooFunctionValue(/** fooFunctionValue param */ b: string)
var lambdaFoo = /** this is lambda comment*/ (/**param a*/a: number, /**param b*/b: number) => a + b;
var lambddaNoVarComment = /** this is lambda multiplication*/ (/**param a*/a: number, /**param b*/b: number) => a * b;
lambdaFoo(10, 20);
lambddaNoVarComment(10, 20);
lambddaNoVarComment(10, 20);
function blah(a: string /* multiline trailing comment
multiline */) {
}
function blah2(a: string /* single line multiple trailing comments */ /* second */) {
}
function blah3(a: string // trailing commen single line
) {
}
//// [commentsFunction.js]
/** This comment should appear for foo*/
@@ -47,6 +58,14 @@ var lambdaFoo = function (a, b) { return a + b; };
var lambddaNoVarComment = function (a, b) { return a * b; };
lambdaFoo(10, 20);
lambddaNoVarComment(10, 20);
function blah(a /* multiline trailing comment
multiline */ ) {
}
function blah2(a /* single line multiple trailing comments */ /* second */ ) {
}
function blah3(a // trailing commen single line
) {
}
//// [commentsFunction.d.ts]
@@ -61,3 +80,6 @@ declare function fooWithParameters(/** this is comment about a*/ a: string, /**
declare var fooFunc: (b: string) => string;
declare var lambdaFoo: (a: number, b: number) => number;
declare var lambddaNoVarComment: (a: number, b: number) => number;
declare function blah(a: string): void;
declare function blah2(a: string): void;
declare function blah3(a: string): void;

View File

@@ -45,7 +45,7 @@ n4 = z2;
//// [commentsVarDecl.js]
/** Variable comments*/
var myVariable = 10; // This trailing Comment1
var myVariable = 10; // This trailing Comment1
/** This is another variable comment*/
var anotherVariable = 30;
// shouldn't appear

View File

@@ -231,7 +231,7 @@ var e;
var r1a1 = a < b;
var r1a1 = a < c;
var r1a1 = a < d;
var r1a1 = a < e; // no error, expected
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; // no error, expected
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; // no error, expected
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; // no error, expected
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; // no error, expected
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; // no error, expected
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; // no error, expected
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; // no error, expected
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; // no error, expected
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; // no error, expected
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; // no error, expected
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; // no error, expected
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; // no error, expected
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; // no error, expected
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; // no error, expected
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; // no error, expected
var r8e1 = e !== a; // no error, expected
var r8e1 = e !== b;
var r8e1 = e !== c;
var r8e1 = e !== d;

View File

@@ -17,6 +17,6 @@ var v2: C<B>; // should not work
var y = v1.x.a; // 'a' should be of type 'number'
//// [constraints0.js]
var v1; // should work
var v2; // should not work
var v1; // should work
var v2; // should not work
var y = v1.x.a; // 'a' should be of type 'number'

View File

@@ -20,4 +20,4 @@ var Bar = (function () {
}
return Bar;
})();
var x; // Error 2 Type '{ a: string; b: number; }' does not satisfy the constraint 'T' for type
var x; // Error 2 Type '{ a: string; b: number; }' does not satisfy the constraint 'T' for type

View File

@@ -29,4 +29,4 @@ var Test;
})(Test || (Test = {}));
var func;
Test.F(func);
var test = new Test.MyClass(func); // Should be OK
var test = new Test.MyClass(func); // Should be OK

View File

@@ -71,8 +71,8 @@ var Generic;
}
return D;
})(C);
var r = C.prototype; // C<any, any>
var ra = r.foo; // any
var r2 = D.prototype; // D<any, any>
var rb = r2.baz; // any
var r = C.prototype; // C<any, any>
var ra = r.foo; // any
var r2 = D.prototype; // D<any, any>
var rb = r2.baz; // any
})(Generic || (Generic = {}));

View File

@@ -27,7 +27,7 @@ var C = (function () {
})();
var c;
var r = c.y;
var r2 = c.x; // error
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; // error
var r2 = d.x; // error
var r3 = d.a; // error

View File

@@ -26,7 +26,7 @@ var r3 = e.y; // error
//// [constructorParameterProperties2.js]
var C = (function () {
function C(y) {
} // ok
} // ok
return C;
})();
var c;
@@ -34,7 +34,7 @@ var r = c.y;
var D = (function () {
function D(y) {
this.y = y;
} // error
} // error
return D;
})();
var d;
@@ -42,7 +42,7 @@ var r2 = d.y;
var E = (function () {
function E(y) {
this.y = y;
} // error
} // error
return E;
})();
var e;

Some files were not shown because too many files have changed in this diff Show More