Merge pull request #10877 from RyanCavanaugh/disallowBadCommas

Disallow bad comma left operands
This commit is contained in:
Ryan Cavanaugh
2016-09-14 11:18:56 -07:00
committed by GitHub
116 changed files with 2104 additions and 618 deletions
+69
View File
@@ -13265,6 +13265,72 @@ namespace ts {
return sourceType;
}
/**
* This is a *shallow* check: An expression is side-effect-free if the
* evaluation of the expression *itself* cannot produce side effects.
* For example, x++ / 3 is side-effect free because the / operator
* does not have side effects.
* The intent is to "smell test" an expression for correctness in positions where
* its value is discarded (e.g. the left side of the comma operator).
*/
function isSideEffectFree(node: Node): boolean {
node = skipParentheses(node);
switch (node.kind) {
case SyntaxKind.Identifier:
case SyntaxKind.StringLiteral:
case SyntaxKind.RegularExpressionLiteral:
case SyntaxKind.TaggedTemplateExpression:
case SyntaxKind.TemplateExpression:
case SyntaxKind.NoSubstitutionTemplateLiteral:
case SyntaxKind.NumericLiteral:
case SyntaxKind.TrueKeyword:
case SyntaxKind.FalseKeyword:
case SyntaxKind.NullKeyword:
case SyntaxKind.UndefinedKeyword:
case SyntaxKind.FunctionExpression:
case SyntaxKind.ClassExpression:
case SyntaxKind.ArrowFunction:
case SyntaxKind.ArrayLiteralExpression:
case SyntaxKind.ObjectLiteralExpression:
case SyntaxKind.TypeOfExpression:
case SyntaxKind.NonNullExpression:
case SyntaxKind.JsxSelfClosingElement:
case SyntaxKind.JsxElement:
return true;
case SyntaxKind.ConditionalExpression:
return isSideEffectFree((node as ConditionalExpression).whenTrue) &&
isSideEffectFree((node as ConditionalExpression).whenFalse);
case SyntaxKind.BinaryExpression:
if (isAssignmentOperator((node as BinaryExpression).operatorToken.kind)) {
return false;
}
return isSideEffectFree((node as BinaryExpression).left) &&
isSideEffectFree((node as BinaryExpression).right);
case SyntaxKind.PrefixUnaryExpression:
case SyntaxKind.PostfixUnaryExpression:
// Unary operators ~, !, +, and - have no side effects.
// The rest do.
switch ((node as PrefixUnaryExpression).operator) {
case SyntaxKind.ExclamationToken:
case SyntaxKind.PlusToken:
case SyntaxKind.MinusToken:
case SyntaxKind.TildeToken:
return true;
}
return false;
// Some forms listed here for clarity
case SyntaxKind.VoidExpression: // Explicit opt-out
case SyntaxKind.TypeAssertionExpression: // Not SEF, but can produce useful type warnings
case SyntaxKind.AsExpression: // Not SEF, but can produce useful type warnings
default:
return false;
}
}
function isTypeEqualityComparableTo(source: Type, target: Type) {
return (target.flags & TypeFlags.Nullable) !== 0 || isTypeComparableTo(source, target);
}
@@ -13426,6 +13492,9 @@ namespace ts {
checkAssignmentOperator(rightType);
return getRegularTypeOfObjectLiteral(rightType);
case SyntaxKind.CommaToken:
if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left)) {
error(left, Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects);
}
return rightType;
}
+4
View File
@@ -1955,6 +1955,10 @@
"category": "Error",
"code": 2694
},
"Left side of comma operator is unused and has no side effects.": {
"category": "Error",
"code": 2695
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",
@@ -1,8 +1,11 @@
tests/cases/compiler/assignmentToParenthesizedExpression1.ts(2,1): error TS2364: Invalid left-hand side of assignment expression.
tests/cases/compiler/assignmentToParenthesizedExpression1.ts(2,2): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/compiler/assignmentToParenthesizedExpression1.ts (1 errors) ====
==== tests/cases/compiler/assignmentToParenthesizedExpression1.ts (2 errors) ====
var x;
(1, x)=0;
~~~~~~
!!! error TS2364: Invalid left-hand side of assignment expression.
!!! error TS2364: Invalid left-hand side of assignment expression.
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
@@ -1,9 +1,10 @@
tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(46,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(47,26): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'.
tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(48,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(47,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(48,26): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'.
tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(49,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
==== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts (3 errors) ====
// ~ operator on any type
var ANY: any;
@@ -1,4 +1,5 @@
//// [bitwiseNotOperatorWithAnyOtherType.ts]
// ~ operator on any type
var ANY: any;
@@ -1,4 +1,5 @@
//// [bitwiseNotOperatorWithBooleanType.ts]
// ~ operator on boolean type
var BOOLEAN: boolean;
@@ -1,89 +1,90 @@
=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithBooleanType.ts ===
// ~ operator on boolean type
var BOOLEAN: boolean;
>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 3))
function foo(): boolean { return true; }
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 21))
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 21))
class A {
>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 3, 40))
>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 4, 40))
public a: boolean;
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9))
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 9))
static foo() { return false; }
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 22))
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 7, 22))
}
module M {
>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 8, 1))
>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 9, 1))
export var n: boolean;
>n : Symbol(n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14))
>n : Symbol(n, Decl(bitwiseNotOperatorWithBooleanType.ts, 11, 14))
}
var objA = new A();
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 13, 3))
>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 3, 40))
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 14, 3))
>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 4, 40))
// boolean type var
var ResultIsNumber1 = ~BOOLEAN;
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithBooleanType.ts, 16, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3))
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithBooleanType.ts, 17, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 3))
// boolean type literal
var ResultIsNumber2 = ~true;
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithBooleanType.ts, 19, 3))
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithBooleanType.ts, 20, 3))
var ResultIsNumber3 = ~{ x: true, y: false };
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithBooleanType.ts, 20, 3))
>x : Symbol(x, Decl(bitwiseNotOperatorWithBooleanType.ts, 20, 24))
>y : Symbol(y, Decl(bitwiseNotOperatorWithBooleanType.ts, 20, 33))
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithBooleanType.ts, 21, 3))
>x : Symbol(x, Decl(bitwiseNotOperatorWithBooleanType.ts, 21, 24))
>y : Symbol(y, Decl(bitwiseNotOperatorWithBooleanType.ts, 21, 33))
// boolean type expressions
var ResultIsNumber4 = ~objA.a;
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithBooleanType.ts, 23, 3))
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9))
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 13, 3))
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9))
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithBooleanType.ts, 24, 3))
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 9))
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 14, 3))
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 9))
var ResultIsNumber5 = ~M.n;
>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithBooleanType.ts, 24, 3))
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14))
>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 8, 1))
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14))
>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithBooleanType.ts, 25, 3))
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 11, 14))
>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 9, 1))
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 11, 14))
var ResultIsNumber6 = ~foo();
>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithBooleanType.ts, 25, 3))
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 21))
>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithBooleanType.ts, 26, 3))
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 21))
var ResultIsNumber7 = ~A.foo();
>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithBooleanType.ts, 26, 3))
>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 22))
>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 3, 40))
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 22))
>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithBooleanType.ts, 27, 3))
>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 7, 22))
>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 4, 40))
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 7, 22))
// multiple ~ operators
var ResultIsNumber8 = ~~BOOLEAN;
>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithBooleanType.ts, 29, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3))
>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithBooleanType.ts, 30, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 3))
// miss assignment operators
~true;
~BOOLEAN;
>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 3))
~foo();
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 21))
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 21))
~true, false;
~objA.a;
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9))
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 13, 3))
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9))
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 9))
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 14, 3))
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 9))
~M.n;
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14))
>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 8, 1))
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14))
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 11, 14))
>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 9, 1))
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 11, 14))
@@ -1,4 +1,5 @@
=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithBooleanType.ts ===
// ~ operator on boolean type
var BOOLEAN: boolean;
>BOOLEAN : boolean
@@ -1,4 +1,5 @@
//// [bitwiseNotOperatorWithEnumType.ts]
// ~ operator on enum type
enum ENUM1 { A, B, "" };
@@ -1,38 +1,39 @@
=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithEnumType.ts ===
// ~ operator on enum type
enum ENUM1 { A, B, "" };
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12))
>B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15))
>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12))
>B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 15))
// enum type var
var ResultIsNumber1 = ~ENUM1;
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithEnumType.ts, 5, 3))
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithEnumType.ts, 6, 3))
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
// enum type expressions
var ResultIsNumber2 = ~ENUM1["A"];
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithEnumType.ts, 8, 3))
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithEnumType.ts, 9, 3))
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12))
>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12))
var ResultIsNumber3 = ~(ENUM1.A + ENUM1["B"]);
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithEnumType.ts, 9, 3))
>ENUM1.A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12))
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithEnumType.ts, 10, 3))
>ENUM1.A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12))
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12))
>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12))
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
>"B" : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15))
>"B" : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 15))
// multiple ~ operators
var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B);
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithEnumType.ts, 12, 3))
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithEnumType.ts, 13, 3))
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12))
>ENUM1.B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15))
>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12))
>ENUM1.B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 15))
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
>B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15))
>B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 15))
// miss assignment operators
~ENUM1;
@@ -40,12 +41,12 @@ var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B);
~ENUM1["A"];
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12))
>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12))
~ENUM1.A, ~ENUM1["B"];
>ENUM1.A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12))
>ENUM1.A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12))
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12))
>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12))
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
>"B" : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15))
>"B" : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 15))
@@ -1,4 +1,5 @@
=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithEnumType.ts ===
// ~ operator on enum type
enum ENUM1 { A, B, "" };
@@ -1,4 +1,5 @@
//// [bitwiseNotOperatorWithNumberType.ts]
// ~ operator on number type
var NUMBER: number;
var NUMBER1: number[] = [1, 2];
@@ -1,126 +1,127 @@
=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithNumberType.ts ===
// ~ operator on number type
var NUMBER: number;
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3))
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
var NUMBER1: number[] = [1, 2];
>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 3))
function foo(): number { return 1; }
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 31))
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 31))
class A {
>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 4, 36))
>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 5, 36))
public a: number;
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9))
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9))
static foo() { return 1; }
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 21))
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 8, 21))
}
module M {
>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1))
>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 10, 1))
export var n: number;
>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14))
>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14))
}
var objA = new A();
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3))
>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 4, 36))
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 15, 3))
>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 5, 36))
// number type var
var ResultIsNumber1 = ~NUMBER;
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithNumberType.ts, 17, 3))
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3))
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithNumberType.ts, 18, 3))
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
var ResultIsNumber2 = ~NUMBER1;
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithNumberType.ts, 18, 3))
>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithNumberType.ts, 19, 3))
>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 3))
// number type literal
var ResultIsNumber3 = ~1;
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithNumberType.ts, 21, 3))
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithNumberType.ts, 22, 3))
var ResultIsNumber4 = ~{ x: 1, y: 2};
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithNumberType.ts, 22, 3))
>x : Symbol(x, Decl(bitwiseNotOperatorWithNumberType.ts, 22, 24))
>y : Symbol(y, Decl(bitwiseNotOperatorWithNumberType.ts, 22, 30))
var ResultIsNumber5 = ~{ x: 1, y: (n: number) => { return n; } };
>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 3))
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 3))
>x : Symbol(x, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 24))
>y : Symbol(y, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 30))
>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 35))
>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 35))
var ResultIsNumber5 = ~{ x: 1, y: (n: number) => { return n; } };
>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithNumberType.ts, 24, 3))
>x : Symbol(x, Decl(bitwiseNotOperatorWithNumberType.ts, 24, 24))
>y : Symbol(y, Decl(bitwiseNotOperatorWithNumberType.ts, 24, 30))
>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 24, 35))
>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 24, 35))
// number type expressions
var ResultIsNumber6 = ~objA.a;
>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithNumberType.ts, 26, 3))
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9))
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3))
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9))
>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithNumberType.ts, 27, 3))
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9))
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 15, 3))
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9))
var ResultIsNumber7 = ~M.n;
>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithNumberType.ts, 27, 3))
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14))
>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1))
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14))
>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithNumberType.ts, 28, 3))
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14))
>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 10, 1))
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14))
var ResultIsNumber8 = ~NUMBER1[0];
>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithNumberType.ts, 28, 3))
>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithNumberType.ts, 29, 3))
>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 3))
var ResultIsNumber9 = ~foo();
>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(bitwiseNotOperatorWithNumberType.ts, 29, 3))
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 31))
>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(bitwiseNotOperatorWithNumberType.ts, 30, 3))
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 31))
var ResultIsNumber10 = ~A.foo();
>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(bitwiseNotOperatorWithNumberType.ts, 30, 3))
>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 21))
>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 4, 36))
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 21))
>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(bitwiseNotOperatorWithNumberType.ts, 31, 3))
>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 8, 21))
>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 5, 36))
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 8, 21))
var ResultIsNumber11 = ~(NUMBER + NUMBER);
>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(bitwiseNotOperatorWithNumberType.ts, 31, 3))
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3))
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3))
>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(bitwiseNotOperatorWithNumberType.ts, 32, 3))
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
// multiple ~ operators
var ResultIsNumber12 = ~~NUMBER;
>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(bitwiseNotOperatorWithNumberType.ts, 34, 3))
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3))
>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(bitwiseNotOperatorWithNumberType.ts, 35, 3))
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
var ResultIsNumber13 = ~~~(NUMBER + NUMBER);
>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(bitwiseNotOperatorWithNumberType.ts, 35, 3))
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3))
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3))
>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(bitwiseNotOperatorWithNumberType.ts, 36, 3))
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
// miss assignment operators
~NUMBER;
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3))
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
~NUMBER1;
>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 3))
~foo();
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 31))
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 31))
~objA.a;
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9))
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3))
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9))
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9))
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 15, 3))
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9))
~M.n;
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14))
>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1))
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14))
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14))
>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 10, 1))
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14))
~objA.a, M.n;
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9))
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3))
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9))
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14))
>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1))
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14))
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9))
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 15, 3))
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9))
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14))
>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 10, 1))
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14))
@@ -1,4 +1,5 @@
=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithNumberType.ts ===
// ~ operator on number type
var NUMBER: number;
>NUMBER : number
@@ -1,4 +1,5 @@
//// [bitwiseNotOperatorWithStringType.ts]
// ~ operator on string type
var STRING: string;
var STRING1: string[] = ["", "abc"];
@@ -1,122 +1,123 @@
=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithStringType.ts ===
// ~ operator on string type
var STRING: string;
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
var STRING1: string[] = ["", "abc"];
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 3, 3))
function foo(): string { return "abc"; }
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 2, 36))
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 3, 36))
class A {
>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 4, 40))
>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 5, 40))
public a: string;
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9))
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 7, 9))
static foo() { return ""; }
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 7, 21))
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 8, 21))
}
module M {
>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 9, 1))
>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 10, 1))
export var n: string;
>n : Symbol(n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14))
>n : Symbol(n, Decl(bitwiseNotOperatorWithStringType.ts, 12, 14))
}
var objA = new A();
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 14, 3))
>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 4, 40))
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 15, 3))
>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 5, 40))
// string type var
var ResultIsNumber1 = ~STRING;
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithStringType.ts, 17, 3))
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithStringType.ts, 18, 3))
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
var ResultIsNumber2 = ~STRING1;
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithStringType.ts, 18, 3))
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithStringType.ts, 19, 3))
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 3, 3))
// string type literal
var ResultIsNumber3 = ~"";
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithStringType.ts, 21, 3))
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithStringType.ts, 22, 3))
var ResultIsNumber4 = ~{ x: "", y: "" };
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithStringType.ts, 22, 3))
>x : Symbol(x, Decl(bitwiseNotOperatorWithStringType.ts, 22, 24))
>y : Symbol(y, Decl(bitwiseNotOperatorWithStringType.ts, 22, 31))
var ResultIsNumber5 = ~{ x: "", y: (s: string) => { return s; } };
>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithStringType.ts, 23, 3))
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithStringType.ts, 23, 3))
>x : Symbol(x, Decl(bitwiseNotOperatorWithStringType.ts, 23, 24))
>y : Symbol(y, Decl(bitwiseNotOperatorWithStringType.ts, 23, 31))
>s : Symbol(s, Decl(bitwiseNotOperatorWithStringType.ts, 23, 36))
>s : Symbol(s, Decl(bitwiseNotOperatorWithStringType.ts, 23, 36))
var ResultIsNumber5 = ~{ x: "", y: (s: string) => { return s; } };
>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithStringType.ts, 24, 3))
>x : Symbol(x, Decl(bitwiseNotOperatorWithStringType.ts, 24, 24))
>y : Symbol(y, Decl(bitwiseNotOperatorWithStringType.ts, 24, 31))
>s : Symbol(s, Decl(bitwiseNotOperatorWithStringType.ts, 24, 36))
>s : Symbol(s, Decl(bitwiseNotOperatorWithStringType.ts, 24, 36))
// string type expressions
var ResultIsNumber6 = ~objA.a;
>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithStringType.ts, 26, 3))
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9))
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 14, 3))
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9))
>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithStringType.ts, 27, 3))
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 7, 9))
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 15, 3))
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 7, 9))
var ResultIsNumber7 = ~M.n;
>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithStringType.ts, 27, 3))
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14))
>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 9, 1))
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14))
>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithStringType.ts, 28, 3))
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 12, 14))
>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 10, 1))
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 12, 14))
var ResultIsNumber8 = ~STRING1[0];
>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithStringType.ts, 28, 3))
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithStringType.ts, 29, 3))
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 3, 3))
var ResultIsNumber9 = ~foo();
>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(bitwiseNotOperatorWithStringType.ts, 29, 3))
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 2, 36))
>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(bitwiseNotOperatorWithStringType.ts, 30, 3))
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 3, 36))
var ResultIsNumber10 = ~A.foo();
>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(bitwiseNotOperatorWithStringType.ts, 30, 3))
>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 7, 21))
>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 4, 40))
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 7, 21))
>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(bitwiseNotOperatorWithStringType.ts, 31, 3))
>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 8, 21))
>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 5, 40))
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 8, 21))
var ResultIsNumber11 = ~(STRING + STRING);
>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(bitwiseNotOperatorWithStringType.ts, 31, 3))
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(bitwiseNotOperatorWithStringType.ts, 32, 3))
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
var ResultIsNumber12 = ~STRING.charAt(0);
>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(bitwiseNotOperatorWithStringType.ts, 32, 3))
>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(bitwiseNotOperatorWithStringType.ts, 33, 3))
>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --))
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
>charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --))
// multiple ~ operators
var ResultIsNumber13 = ~~STRING;
>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(bitwiseNotOperatorWithStringType.ts, 35, 3))
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(bitwiseNotOperatorWithStringType.ts, 36, 3))
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
var ResultIsNumber14 = ~~~(STRING + STRING);
>ResultIsNumber14 : Symbol(ResultIsNumber14, Decl(bitwiseNotOperatorWithStringType.ts, 36, 3))
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
>ResultIsNumber14 : Symbol(ResultIsNumber14, Decl(bitwiseNotOperatorWithStringType.ts, 37, 3))
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
//miss assignment operators
~STRING;
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
~STRING1;
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 3, 3))
~foo();
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 2, 36))
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 3, 36))
~objA.a,M.n;
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9))
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 14, 3))
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9))
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14))
>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 9, 1))
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14))
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 7, 9))
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 15, 3))
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 7, 9))
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 12, 14))
>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 10, 1))
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 12, 14))
@@ -1,4 +1,5 @@
=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithStringType.ts ===
// ~ operator on string type
var STRING: string;
>STRING : string
@@ -0,0 +1,33 @@
tests/cases/compiler/commaOperator1.ts(1,11): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperator1.ts(1,11): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperator1.ts(1,11): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperator1.ts(1,12): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperator1.ts(1,12): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperator1.ts(1,29): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperator1.ts(4,12): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperator1.ts(4,12): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/compiler/commaOperator1.ts (8 errors) ====
var v1 = ((1, 2, 3), 4, 5, (6, 7));
~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~~~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~~~~~~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
function f1() {
var a = 1;
return a, v1, a;
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
}
@@ -1,12 +1,13 @@
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(10,1): error TS2322: Type 'string' is not assignable to type 'boolean'.
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(11,1): error TS2322: Type 'number' is not assignable to type 'boolean'.
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(13,1): error TS2322: Type 'boolean' is not assignable to type 'number'.
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(14,1): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(16,1): error TS2322: Type 'boolean' is not assignable to type 'string'.
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(17,1): error TS2322: Type 'number' is not assignable to type 'string'.
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(11,1): error TS2322: Type 'string' is not assignable to type 'boolean'.
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(12,1): error TS2322: Type 'number' is not assignable to type 'boolean'.
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(14,1): error TS2322: Type 'boolean' is not assignable to type 'number'.
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(15,1): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(17,1): error TS2322: Type 'boolean' is not assignable to type 'string'.
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(18,1): error TS2322: Type 'number' is not assignable to type 'string'.
==== tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts (6 errors) ====
var BOOLEAN: boolean;
var NUMBER: number;
var STRING: string;
@@ -1,4 +1,5 @@
//// [commaOperatorInvalidAssignmentType.ts]
var BOOLEAN: boolean;
var NUMBER: number;
var STRING: string;
@@ -0,0 +1,125 @@
tests/cases/compiler/commaOperatorLeftSideUnused.ts(8,10): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(16,19): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(19,21): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(22,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(23,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(24,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(25,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(26,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(27,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(28,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(29,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(30,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(31,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(32,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(33,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(34,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(35,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(36,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(37,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(38,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(39,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(40,7): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/commaOperatorLeftSideUnused.ts(41,7): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/compiler/commaOperatorLeftSideUnused.ts (23 errors) ====
var xx: any;
var yy: any;
function fn() {
let arr: any[] = [];
switch(arr.length) {
// Should error
case 0, 1:
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
return 'zero or one';
default:
return 'more than one';
}
}
// Should error
let x = Math.pow((3, 5), 2);
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
// Should error
let a = [(3 + 4), ((1 + 1, 8) * 4)];
~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
// Error cases
xx = (1, 2);
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = ('', xx);
~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = (/323/, 5);
~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = (`wat`, 'ok'),
~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = (true, false);
~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = (false, true);
~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = (null, xx);
~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = (undefined, 10);
~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = (() => {}, 'no');
~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = (function() { }, 100);
~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = ({}, {});
~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = (typeof xx, 'unused');
~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = ([1, 2, x++], xx);
~~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = (xx!, xx);
~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = (xx ? 3 : 4, 10);
~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = (3 + 4, 10);
~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = (!xx, 10);
~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = (~xx, 10);
~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = (-xx, 10);
~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
xx = (+xx, 10);
~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
// OK cases
xx = (xx ? x++ : 4, 10);
xx = (--xx, 3);
xx = (xx = 3, 1);
xx = ((xx = 3), 5);
xx = (xx+= 4, xx);
xx = ((xx+= 4), xx);
xx = (Math.pow(3, 2), 4);
xx = (void xx, 10);
xx = (xx as any, 100);
@@ -0,0 +1,103 @@
//// [commaOperatorLeftSideUnused.ts]
var xx: any;
var yy: any;
function fn() {
let arr: any[] = [];
switch(arr.length) {
// Should error
case 0, 1:
return 'zero or one';
default:
return 'more than one';
}
}
// Should error
let x = Math.pow((3, 5), 2);
// Should error
let a = [(3 + 4), ((1 + 1, 8) * 4)];
// Error cases
xx = (1, 2);
xx = ('', xx);
xx = (/323/, 5);
xx = (`wat`, 'ok'),
xx = (true, false);
xx = (false, true);
xx = (null, xx);
xx = (undefined, 10);
xx = (() => {}, 'no');
xx = (function() { }, 100);
xx = ({}, {});
xx = (typeof xx, 'unused');
xx = ([1, 2, x++], xx);
xx = (xx!, xx);
xx = (xx ? 3 : 4, 10);
xx = (3 + 4, 10);
xx = (!xx, 10);
xx = (~xx, 10);
xx = (-xx, 10);
xx = (+xx, 10);
// OK cases
xx = (xx ? x++ : 4, 10);
xx = (--xx, 3);
xx = (xx = 3, 1);
xx = ((xx = 3), 5);
xx = (xx+= 4, xx);
xx = ((xx+= 4), xx);
xx = (Math.pow(3, 2), 4);
xx = (void xx, 10);
xx = (xx as any, 100);
//// [commaOperatorLeftSideUnused.js]
var xx;
var yy;
function fn() {
var arr = [];
switch (arr.length) {
// Should error
case 0, 1:
return 'zero or one';
default:
return 'more than one';
}
}
// Should error
var x = Math.pow((3, 5), 2);
// Should error
var a = [(3 + 4), ((1 + 1, 8) * 4)];
// Error cases
xx = (1, 2);
xx = ('', xx);
xx = (/323/, 5);
xx = ("wat", 'ok'),
xx = (true, false);
xx = (false, true);
xx = (null, xx);
xx = (undefined, 10);
xx = (function () { }, 'no');
xx = (function () { }, 100);
xx = ({}, {});
xx = (typeof xx, 'unused');
xx = ([1, 2, x++], xx);
xx = (xx, xx);
xx = (xx ? 3 : 4, 10);
xx = (3 + 4, 10);
xx = (!xx, 10);
xx = (~xx, 10);
xx = (-xx, 10);
xx = (+xx, 10);
// OK cases
xx = (xx ? x++ : 4, 10);
xx = (--xx, 3);
xx = (xx = 3, 1);
xx = ((xx = 3), 5);
xx = (xx += 4, xx);
xx = ((xx += 4), xx);
xx = (Math.pow(3, 2), 4);
xx = (void xx, 10);
xx = (xx, 100);
@@ -1,8 +1,9 @@
tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(6,5): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(12,9): error TS2322: Type 'T2' is not assignable to type 'T1'.
tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(7,5): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(13,9): error TS2322: Type 'T2' is not assignable to type 'T1'.
==== tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts (2 errors) ====
//Expect to have compiler errors
//Comma operator in fuction arguments and return
function foo(x: number, y: string) {
@@ -1,4 +1,5 @@
//// [commaOperatorOtherInvalidOperation.ts]
//Expect to have compiler errors
//Comma operator in fuction arguments and return
function foo(x: number, y: string) {
@@ -1,4 +1,5 @@
//// [commaOperatorOtherValidOperation.ts]
//Comma operator in for loop
for (var i = 0, j = 10; i < j; i++, j--)
{
@@ -1,50 +1,51 @@
=== tests/cases/conformance/expressions/commaOperator/commaOperatorOtherValidOperation.ts ===
//Comma operator in for loop
for (var i = 0, j = 10; i < j; i++, j--)
>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8))
>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15))
>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8))
>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15))
>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8))
>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15))
>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 2, 8))
>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 2, 15))
>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 2, 8))
>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 2, 15))
>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 2, 8))
>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 2, 15))
{
}
//Comma operator in fuction arguments and return
function foo(x: number, y: string)
>foo : Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 3, 1))
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 6, 13))
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 6, 23))
>foo : Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 4, 1))
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 7, 13))
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 7, 23))
{
return x, y;
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 6, 13))
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 6, 23))
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 7, 13))
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 7, 23))
}
var resultIsString = foo(1, "123");
>resultIsString : Symbol(resultIsString, Decl(commaOperatorOtherValidOperation.ts, 10, 3))
>foo : Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 3, 1))
>resultIsString : Symbol(resultIsString, Decl(commaOperatorOtherValidOperation.ts, 11, 3))
>foo : Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 4, 1))
//TypeParameters
function foo1<T1, T2>()
>foo1 : Symbol(foo1, Decl(commaOperatorOtherValidOperation.ts, 10, 35))
>T1 : Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 13, 14))
>T2 : Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 13, 17))
>foo1 : Symbol(foo1, Decl(commaOperatorOtherValidOperation.ts, 11, 35))
>T1 : Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 14, 14))
>T2 : Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 14, 17))
{
var x: T1;
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7))
>T1 : Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 13, 14))
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 16, 7))
>T1 : Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 14, 14))
var y: T2;
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7))
>T2 : Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 13, 17))
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 17, 7))
>T2 : Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 14, 17))
x, y;
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7))
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7))
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 16, 7))
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 17, 7))
var resultIsT1 = (y, x);
>resultIsT1 : Symbol(resultIsT1, Decl(commaOperatorOtherValidOperation.ts, 18, 7))
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7))
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7))
>resultIsT1 : Symbol(resultIsT1, Decl(commaOperatorOtherValidOperation.ts, 19, 7))
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 17, 7))
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 16, 7))
}
@@ -1,4 +1,5 @@
=== tests/cases/conformance/expressions/commaOperator/commaOperatorOtherValidOperation.ts ===
//Comma operator in for loop
for (var i = 0, j = 10; i < j; i++, j--)
>i : number
@@ -1,4 +1,5 @@
//// [commaOperatorWithSecondOperandAnyType.ts]
var ANY: any;
var BOOLEAN: boolean;
var NUMBER: number;
@@ -1,77 +1,78 @@
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandAnyType.ts ===
var ANY: any;
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
var BOOLEAN: boolean;
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
var NUMBER: number;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
var STRING: string;
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3))
var OBJECT: Object;
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 5, 3))
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
//The second operand type is any
ANY, ANY;
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
BOOLEAN, ANY;
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
NUMBER, ANY;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
STRING, ANY;
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
OBJECT, ANY;
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 5, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
//Return type is any
var resultIsAny1 = (ANY, ANY);
>resultIsAny1 : Symbol(resultIsAny1, Decl(commaOperatorWithSecondOperandAnyType.ts, 14, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>resultIsAny1 : Symbol(resultIsAny1, Decl(commaOperatorWithSecondOperandAnyType.ts, 15, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
var resultIsAny2 = (BOOLEAN, ANY);
>resultIsAny2 : Symbol(resultIsAny2, Decl(commaOperatorWithSecondOperandAnyType.ts, 15, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>resultIsAny2 : Symbol(resultIsAny2, Decl(commaOperatorWithSecondOperandAnyType.ts, 16, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
var resultIsAny3 = (NUMBER, ANY);
>resultIsAny3 : Symbol(resultIsAny3, Decl(commaOperatorWithSecondOperandAnyType.ts, 16, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>resultIsAny3 : Symbol(resultIsAny3, Decl(commaOperatorWithSecondOperandAnyType.ts, 17, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
var resultIsAny4 = (STRING, ANY);
>resultIsAny4 : Symbol(resultIsAny4, Decl(commaOperatorWithSecondOperandAnyType.ts, 17, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>resultIsAny4 : Symbol(resultIsAny4, Decl(commaOperatorWithSecondOperandAnyType.ts, 18, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
var resultIsAny5 = (OBJECT, ANY);
>resultIsAny5 : Symbol(resultIsAny5, Decl(commaOperatorWithSecondOperandAnyType.ts, 18, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>resultIsAny5 : Symbol(resultIsAny5, Decl(commaOperatorWithSecondOperandAnyType.ts, 19, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 5, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
//Literal and expression
var x: any;
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3))
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 22, 3))
1, ANY;
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
++NUMBER, ANY;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
"string", [null, 1];
"string".charAt(0), [null, 1];
@@ -79,36 +80,36 @@ var x: any;
>charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --))
true, x("any");
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3))
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 22, 3))
!BOOLEAN, x.doSomeThing();
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 22, 3))
var resultIsAny6 = (1, ANY);
>resultIsAny6 : Symbol(resultIsAny6, Decl(commaOperatorWithSecondOperandAnyType.ts, 30, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>resultIsAny6 : Symbol(resultIsAny6, Decl(commaOperatorWithSecondOperandAnyType.ts, 31, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
var resultIsAny7 = (++NUMBER, ANY);
>resultIsAny7 : Symbol(resultIsAny7, Decl(commaOperatorWithSecondOperandAnyType.ts, 31, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
>resultIsAny7 : Symbol(resultIsAny7, Decl(commaOperatorWithSecondOperandAnyType.ts, 32, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
var resultIsAny8 = ("string", null);
>resultIsAny8 : Symbol(resultIsAny8, Decl(commaOperatorWithSecondOperandAnyType.ts, 32, 3))
>resultIsAny8 : Symbol(resultIsAny8, Decl(commaOperatorWithSecondOperandAnyType.ts, 33, 3))
var resultIsAny9 = ("string".charAt(0), undefined);
>resultIsAny9 : Symbol(resultIsAny9, Decl(commaOperatorWithSecondOperandAnyType.ts, 33, 3))
>resultIsAny9 : Symbol(resultIsAny9, Decl(commaOperatorWithSecondOperandAnyType.ts, 34, 3))
>"string".charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --))
>charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --))
>undefined : Symbol(undefined)
var resultIsAny10 = (true, x("any"));
>resultIsAny10 : Symbol(resultIsAny10, Decl(commaOperatorWithSecondOperandAnyType.ts, 34, 3))
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3))
>resultIsAny10 : Symbol(resultIsAny10, Decl(commaOperatorWithSecondOperandAnyType.ts, 35, 3))
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 22, 3))
var resultIsAny11 = (!BOOLEAN, x.doSomeThing());
>resultIsAny11 : Symbol(resultIsAny11, Decl(commaOperatorWithSecondOperandAnyType.ts, 35, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3))
>resultIsAny11 : Symbol(resultIsAny11, Decl(commaOperatorWithSecondOperandAnyType.ts, 36, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 22, 3))
@@ -1,4 +1,5 @@
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandAnyType.ts ===
var ANY: any;
>ANY : any
@@ -1,4 +1,5 @@
//// [commaOperatorWithSecondOperandBooleanType.ts]
var ANY: any;
var BOOLEAN: boolean;
var NUMBER: number;
@@ -1,110 +1,111 @@
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandBooleanType.ts ===
var ANY: any;
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
var BOOLEAN: boolean;
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
var NUMBER: number;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3))
var STRING: string;
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3))
var OBJECT: Object;
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 5, 3))
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
//The second operand type is boolean
ANY, BOOLEAN;
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
BOOLEAN, BOOLEAN;
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
NUMBER, BOOLEAN;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
STRING, BOOLEAN;
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
OBJECT, BOOLEAN;
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 5, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
//Return type is boolean
var resultIsBoolean1 = (ANY, BOOLEAN);
>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(commaOperatorWithSecondOperandBooleanType.ts, 14, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(commaOperatorWithSecondOperandBooleanType.ts, 15, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
var resultIsBoolean2 = (BOOLEAN, BOOLEAN);
>resultIsBoolean2 : Symbol(resultIsBoolean2, Decl(commaOperatorWithSecondOperandBooleanType.ts, 15, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>resultIsBoolean2 : Symbol(resultIsBoolean2, Decl(commaOperatorWithSecondOperandBooleanType.ts, 16, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
var resultIsBoolean3 = (NUMBER, BOOLEAN);
>resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(commaOperatorWithSecondOperandBooleanType.ts, 16, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(commaOperatorWithSecondOperandBooleanType.ts, 17, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
var resultIsBoolean4 = (STRING, BOOLEAN);
>resultIsBoolean4 : Symbol(resultIsBoolean4, Decl(commaOperatorWithSecondOperandBooleanType.ts, 17, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>resultIsBoolean4 : Symbol(resultIsBoolean4, Decl(commaOperatorWithSecondOperandBooleanType.ts, 18, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
var resultIsBoolean5 = (OBJECT, BOOLEAN);
>resultIsBoolean5 : Symbol(resultIsBoolean5, Decl(commaOperatorWithSecondOperandBooleanType.ts, 18, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>resultIsBoolean5 : Symbol(resultIsBoolean5, Decl(commaOperatorWithSecondOperandBooleanType.ts, 19, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 5, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
//Literal and expression
null, BOOLEAN;
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
ANY = undefined, BOOLEAN;
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>undefined : Symbol(undefined)
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
1, true;
++NUMBER, true;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3))
[1, 2, 3], !BOOLEAN;
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
OBJECT = [1, 2, 3], BOOLEAN = false;
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 5, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
var resultIsBoolean6 = (null, BOOLEAN);
>resultIsBoolean6 : Symbol(resultIsBoolean6, Decl(commaOperatorWithSecondOperandBooleanType.ts, 28, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>resultIsBoolean6 : Symbol(resultIsBoolean6, Decl(commaOperatorWithSecondOperandBooleanType.ts, 29, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
var resultIsBoolean7 = (ANY = undefined, BOOLEAN);
>resultIsBoolean7 : Symbol(resultIsBoolean7, Decl(commaOperatorWithSecondOperandBooleanType.ts, 29, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3))
>resultIsBoolean7 : Symbol(resultIsBoolean7, Decl(commaOperatorWithSecondOperandBooleanType.ts, 30, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>undefined : Symbol(undefined)
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
var resultIsBoolean8 = (1, true);
>resultIsBoolean8 : Symbol(resultIsBoolean8, Decl(commaOperatorWithSecondOperandBooleanType.ts, 30, 3))
>resultIsBoolean8 : Symbol(resultIsBoolean8, Decl(commaOperatorWithSecondOperandBooleanType.ts, 31, 3))
var resultIsBoolean9 = (++NUMBER, true);
>resultIsBoolean9 : Symbol(resultIsBoolean9, Decl(commaOperatorWithSecondOperandBooleanType.ts, 31, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
>resultIsBoolean9 : Symbol(resultIsBoolean9, Decl(commaOperatorWithSecondOperandBooleanType.ts, 32, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3))
var resultIsBoolean10 = ([1, 2, 3], !BOOLEAN);
>resultIsBoolean10 : Symbol(resultIsBoolean10, Decl(commaOperatorWithSecondOperandBooleanType.ts, 32, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>resultIsBoolean10 : Symbol(resultIsBoolean10, Decl(commaOperatorWithSecondOperandBooleanType.ts, 33, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
var resultIsBoolean11 = (OBJECT = [1, 2, 3], BOOLEAN = false);
>resultIsBoolean11 : Symbol(resultIsBoolean11, Decl(commaOperatorWithSecondOperandBooleanType.ts, 33, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
>resultIsBoolean11 : Symbol(resultIsBoolean11, Decl(commaOperatorWithSecondOperandBooleanType.ts, 34, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 5, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
@@ -1,4 +1,5 @@
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandBooleanType.ts ===
var ANY: any;
>ANY : any
@@ -1,4 +1,5 @@
//// [commaOperatorWithSecondOperandNumberType.ts]
var ANY: any;
var BOOLEAN: boolean;
var NUMBER: number;
@@ -1,114 +1,115 @@
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandNumberType.ts ===
var ANY: any;
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
var BOOLEAN: boolean;
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
var NUMBER: number;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
var STRING: string;
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3))
var OBJECT: Object;
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 5, 3))
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
//The second operand type is number
ANY, NUMBER;
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
BOOLEAN, NUMBER;
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
NUMBER, NUMBER;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
STRING, NUMBER;
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
OBJECT, NUMBER;
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 5, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
//Return type is number
var resultIsNumber1 = (ANY, NUMBER);
>resultIsNumber1 : Symbol(resultIsNumber1, Decl(commaOperatorWithSecondOperandNumberType.ts, 14, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>resultIsNumber1 : Symbol(resultIsNumber1, Decl(commaOperatorWithSecondOperandNumberType.ts, 15, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
var resultIsNumber2 = (BOOLEAN, NUMBER);
>resultIsNumber2 : Symbol(resultIsNumber2, Decl(commaOperatorWithSecondOperandNumberType.ts, 15, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>resultIsNumber2 : Symbol(resultIsNumber2, Decl(commaOperatorWithSecondOperandNumberType.ts, 16, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
var resultIsNumber3 = (NUMBER, NUMBER);
>resultIsNumber3 : Symbol(resultIsNumber3, Decl(commaOperatorWithSecondOperandNumberType.ts, 16, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>resultIsNumber3 : Symbol(resultIsNumber3, Decl(commaOperatorWithSecondOperandNumberType.ts, 17, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
var resultIsNumber4 = (STRING, NUMBER);
>resultIsNumber4 : Symbol(resultIsNumber4, Decl(commaOperatorWithSecondOperandNumberType.ts, 17, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>resultIsNumber4 : Symbol(resultIsNumber4, Decl(commaOperatorWithSecondOperandNumberType.ts, 18, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
var resultIsNumber5 = (OBJECT, NUMBER);
>resultIsNumber5 : Symbol(resultIsNumber5, Decl(commaOperatorWithSecondOperandNumberType.ts, 18, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>resultIsNumber5 : Symbol(resultIsNumber5, Decl(commaOperatorWithSecondOperandNumberType.ts, 19, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 5, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
//Literal and expression
null, NUMBER;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
ANY = undefined, NUMBER;
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
>undefined : Symbol(undefined)
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
true, 1;
BOOLEAN = false, 1;
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
"", NUMBER = 1;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
STRING.trim(), NUMBER = 1;
>STRING.trim : Symbol(String.trim, Decl(lib.d.ts, --, --))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3))
>trim : Symbol(String.trim, Decl(lib.d.ts, --, --))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
var resultIsNumber6 = (null, NUMBER);
>resultIsNumber6 : Symbol(resultIsNumber6, Decl(commaOperatorWithSecondOperandNumberType.ts, 28, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>resultIsNumber6 : Symbol(resultIsNumber6, Decl(commaOperatorWithSecondOperandNumberType.ts, 29, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
var resultIsNumber7 = (ANY = undefined, NUMBER);
>resultIsNumber7 : Symbol(resultIsNumber7, Decl(commaOperatorWithSecondOperandNumberType.ts, 29, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3))
>resultIsNumber7 : Symbol(resultIsNumber7, Decl(commaOperatorWithSecondOperandNumberType.ts, 30, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
>undefined : Symbol(undefined)
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
var resultIsNumber8 = (true, 1);
>resultIsNumber8 : Symbol(resultIsNumber8, Decl(commaOperatorWithSecondOperandNumberType.ts, 30, 3))
>resultIsNumber8 : Symbol(resultIsNumber8, Decl(commaOperatorWithSecondOperandNumberType.ts, 31, 3))
var resultIsNumber9 = (BOOLEAN = false, 1);
>resultIsNumber9 : Symbol(resultIsNumber9, Decl(commaOperatorWithSecondOperandNumberType.ts, 31, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
>resultIsNumber9 : Symbol(resultIsNumber9, Decl(commaOperatorWithSecondOperandNumberType.ts, 32, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
var resultIsNumber10 = ("", NUMBER = 1);
>resultIsNumber10 : Symbol(resultIsNumber10, Decl(commaOperatorWithSecondOperandNumberType.ts, 32, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>resultIsNumber10 : Symbol(resultIsNumber10, Decl(commaOperatorWithSecondOperandNumberType.ts, 33, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
var resultIsNumber11 = (STRING.trim(), NUMBER = 1);
>resultIsNumber11 : Symbol(resultIsNumber11, Decl(commaOperatorWithSecondOperandNumberType.ts, 33, 3))
>resultIsNumber11 : Symbol(resultIsNumber11, Decl(commaOperatorWithSecondOperandNumberType.ts, 34, 3))
>STRING.trim : Symbol(String.trim, Decl(lib.d.ts, --, --))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3))
>trim : Symbol(String.trim, Decl(lib.d.ts, --, --))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
@@ -1,4 +1,5 @@
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandNumberType.ts ===
var ANY: any;
>ANY : any
@@ -1,4 +1,5 @@
//// [commaOperatorWithSecondOperandObjectType.ts]
var ANY: any;
var BOOLEAN: boolean;
var NUMBER: number;
@@ -1,121 +1,122 @@
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandObjectType.ts ===
var ANY: any;
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
var BOOLEAN: boolean;
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3))
var NUMBER: number;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3))
var STRING: string;
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
var OBJECT: Object;
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
class CLASS {
>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 19))
>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 19))
num: number;
>num : Symbol(CLASS.num, Decl(commaOperatorWithSecondOperandObjectType.ts, 6, 13))
>num : Symbol(CLASS.num, Decl(commaOperatorWithSecondOperandObjectType.ts, 7, 13))
}
//The second operand type is Object
ANY, OBJECT;
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
BOOLEAN, OBJECT;
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
NUMBER, OBJECT;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
STRING, OBJECT;
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
OBJECT, OBJECT;
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
//Return type is Object
var resultIsObject1 = (ANY, OBJECT);
>resultIsObject1 : Symbol(resultIsObject1, Decl(commaOperatorWithSecondOperandObjectType.ts, 18, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>resultIsObject1 : Symbol(resultIsObject1, Decl(commaOperatorWithSecondOperandObjectType.ts, 19, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
var resultIsObject2 = (BOOLEAN, OBJECT);
>resultIsObject2 : Symbol(resultIsObject2, Decl(commaOperatorWithSecondOperandObjectType.ts, 19, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>resultIsObject2 : Symbol(resultIsObject2, Decl(commaOperatorWithSecondOperandObjectType.ts, 20, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
var resultIsObject3 = (NUMBER, OBJECT);
>resultIsObject3 : Symbol(resultIsObject3, Decl(commaOperatorWithSecondOperandObjectType.ts, 20, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>resultIsObject3 : Symbol(resultIsObject3, Decl(commaOperatorWithSecondOperandObjectType.ts, 21, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
var resultIsObject4 = (STRING, OBJECT);
>resultIsObject4 : Symbol(resultIsObject4, Decl(commaOperatorWithSecondOperandObjectType.ts, 21, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>resultIsObject4 : Symbol(resultIsObject4, Decl(commaOperatorWithSecondOperandObjectType.ts, 22, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
var resultIsObject5 = (OBJECT, OBJECT);
>resultIsObject5 : Symbol(resultIsObject5, Decl(commaOperatorWithSecondOperandObjectType.ts, 22, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>resultIsObject5 : Symbol(resultIsObject5, Decl(commaOperatorWithSecondOperandObjectType.ts, 23, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
//Literal and expression
null, OBJECT
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
ANY = null, OBJECT
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
true, {}
!BOOLEAN, []
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3))
"string", new Date()
>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
STRING.toLowerCase(), new CLASS()
>STRING.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --))
>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 19))
>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 19))
var resultIsObject6 = (null, OBJECT);
>resultIsObject6 : Symbol(resultIsObject6, Decl(commaOperatorWithSecondOperandObjectType.ts, 32, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>resultIsObject6 : Symbol(resultIsObject6, Decl(commaOperatorWithSecondOperandObjectType.ts, 33, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
var resultIsObject7 = (ANY = null, OBJECT);
>resultIsObject7 : Symbol(resultIsObject7, Decl(commaOperatorWithSecondOperandObjectType.ts, 33, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>resultIsObject7 : Symbol(resultIsObject7, Decl(commaOperatorWithSecondOperandObjectType.ts, 34, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
var resultIsObject8 = (true, {});
>resultIsObject8 : Symbol(resultIsObject8, Decl(commaOperatorWithSecondOperandObjectType.ts, 34, 3))
>resultIsObject8 : Symbol(resultIsObject8, Decl(commaOperatorWithSecondOperandObjectType.ts, 35, 3))
var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" });
>resultIsObject9 : Symbol(resultIsObject9, Decl(commaOperatorWithSecondOperandObjectType.ts, 35, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
>a : Symbol(a, Decl(commaOperatorWithSecondOperandObjectType.ts, 35, 34))
>b : Symbol(b, Decl(commaOperatorWithSecondOperandObjectType.ts, 35, 40))
>resultIsObject9 : Symbol(resultIsObject9, Decl(commaOperatorWithSecondOperandObjectType.ts, 36, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3))
>a : Symbol(a, Decl(commaOperatorWithSecondOperandObjectType.ts, 36, 34))
>b : Symbol(b, Decl(commaOperatorWithSecondOperandObjectType.ts, 36, 40))
var resultIsObject10 = ("string", new Date());
>resultIsObject10 : Symbol(resultIsObject10, Decl(commaOperatorWithSecondOperandObjectType.ts, 36, 3))
>resultIsObject10 : Symbol(resultIsObject10, Decl(commaOperatorWithSecondOperandObjectType.ts, 37, 3))
>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
var resultIsObject11 = (STRING.toLowerCase(), new CLASS());
>resultIsObject11 : Symbol(resultIsObject11, Decl(commaOperatorWithSecondOperandObjectType.ts, 37, 3))
>resultIsObject11 : Symbol(resultIsObject11, Decl(commaOperatorWithSecondOperandObjectType.ts, 38, 3))
>STRING.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --))
>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 19))
>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 19))
@@ -1,4 +1,5 @@
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandObjectType.ts ===
var ANY: any;
>ANY : any
@@ -1,4 +1,5 @@
//// [commaOperatorWithSecondOperandStringType.ts]
var ANY: any;
var BOOLEAN: boolean;
var NUMBER: number;
@@ -1,120 +1,121 @@
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandStringType.ts ===
var ANY: any;
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
var BOOLEAN: boolean;
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
var NUMBER: number;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
var STRING: string;
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
var OBJECT: Object;
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 5, 3))
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
var resultIsString: string;
>resultIsString : Symbol(resultIsString, Decl(commaOperatorWithSecondOperandStringType.ts, 6, 3))
>resultIsString : Symbol(resultIsString, Decl(commaOperatorWithSecondOperandStringType.ts, 7, 3))
//The second operand is string
ANY, STRING;
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
BOOLEAN, STRING;
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
NUMBER, STRING;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
STRING, STRING;
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
OBJECT, STRING;
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 5, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
//Return type is string
var resultIsString1 = (ANY, STRING);
>resultIsString1 : Symbol(resultIsString1, Decl(commaOperatorWithSecondOperandStringType.ts, 16, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>resultIsString1 : Symbol(resultIsString1, Decl(commaOperatorWithSecondOperandStringType.ts, 17, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
var resultIsString2 = (BOOLEAN, STRING);
>resultIsString2 : Symbol(resultIsString2, Decl(commaOperatorWithSecondOperandStringType.ts, 17, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>resultIsString2 : Symbol(resultIsString2, Decl(commaOperatorWithSecondOperandStringType.ts, 18, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
var resultIsString3 = (NUMBER, STRING);
>resultIsString3 : Symbol(resultIsString3, Decl(commaOperatorWithSecondOperandStringType.ts, 18, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>resultIsString3 : Symbol(resultIsString3, Decl(commaOperatorWithSecondOperandStringType.ts, 19, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
var resultIsString4 = (STRING, STRING);
>resultIsString4 : Symbol(resultIsString4, Decl(commaOperatorWithSecondOperandStringType.ts, 19, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>resultIsString4 : Symbol(resultIsString4, Decl(commaOperatorWithSecondOperandStringType.ts, 20, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
var resultIsString5 = (OBJECT, STRING);
>resultIsString5 : Symbol(resultIsString5, Decl(commaOperatorWithSecondOperandStringType.ts, 20, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>resultIsString5 : Symbol(resultIsString5, Decl(commaOperatorWithSecondOperandStringType.ts, 21, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 5, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
//Literal and expression
null, STRING;
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
ANY = new Date(), STRING;
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
true, "";
BOOLEAN == undefined, "";
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
>undefined : Symbol(undefined)
["a", "b"], NUMBER.toString();
>NUMBER.toString : Symbol(Number.toString, Decl(lib.d.ts, --, --))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>toString : Symbol(Number.toString, Decl(lib.d.ts, --, --))
OBJECT = new Object, STRING + "string";
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 5, 3))
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
var resultIsString6 = (null, STRING);
>resultIsString6 : Symbol(resultIsString6, Decl(commaOperatorWithSecondOperandStringType.ts, 30, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>resultIsString6 : Symbol(resultIsString6, Decl(commaOperatorWithSecondOperandStringType.ts, 31, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
var resultIsString7 = (ANY = new Date(), STRING);
>resultIsString7 : Symbol(resultIsString7, Decl(commaOperatorWithSecondOperandStringType.ts, 31, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3))
>resultIsString7 : Symbol(resultIsString7, Decl(commaOperatorWithSecondOperandStringType.ts, 32, 3))
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
var resultIsString8 = (true, "");
>resultIsString8 : Symbol(resultIsString8, Decl(commaOperatorWithSecondOperandStringType.ts, 32, 3))
>resultIsString8 : Symbol(resultIsString8, Decl(commaOperatorWithSecondOperandStringType.ts, 33, 3))
var resultIsString9 = (BOOLEAN == undefined, "");
>resultIsString9 : Symbol(resultIsString9, Decl(commaOperatorWithSecondOperandStringType.ts, 33, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
>resultIsString9 : Symbol(resultIsString9, Decl(commaOperatorWithSecondOperandStringType.ts, 34, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
>undefined : Symbol(undefined)
var resultIsString10 = (["a", "b"], NUMBER.toString());
>resultIsString10 : Symbol(resultIsString10, Decl(commaOperatorWithSecondOperandStringType.ts, 34, 3))
>resultIsString10 : Symbol(resultIsString10, Decl(commaOperatorWithSecondOperandStringType.ts, 35, 3))
>NUMBER.toString : Symbol(Number.toString, Decl(lib.d.ts, --, --))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>toString : Symbol(Number.toString, Decl(lib.d.ts, --, --))
var resultIsString11 = (new Object, STRING + "string");
>resultIsString11 : Symbol(resultIsString11, Decl(commaOperatorWithSecondOperandStringType.ts, 35, 3))
>resultIsString11 : Symbol(resultIsString11, Decl(commaOperatorWithSecondOperandStringType.ts, 36, 3))
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
@@ -1,4 +1,5 @@
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandStringType.ts ===
var ANY: any;
>ANY : any
@@ -1,18 +1,29 @@
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(9,2): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(9,7): error TS1109: Expression expected.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(10,2): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(10,11): error TS1109: Expression expected.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(11,2): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(11,10): error TS1109: Expression expected.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(12,2): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(12,10): error TS1109: Expression expected.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(13,2): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(13,10): error TS1109: Expression expected.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(16,2): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(16,2): error TS1109: Expression expected.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(17,2): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(17,2): error TS1109: Expression expected.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(18,2): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(18,2): error TS1109: Expression expected.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(19,2): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(19,2): error TS1109: Expression expected.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(20,2): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(20,2): error TS1109: Expression expected.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(23,2): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(23,3): error TS1109: Expression expected.
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(23,5): error TS1109: Expression expected.
==== tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts (12 errors) ====
==== tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts (23 errors) ====
var ANY: any;
var BOOLEAN: boolean;
var NUMBER: number;
@@ -22,40 +33,62 @@ tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts
// Expect to have compiler errors
// Missing the second operand
(ANY, );
~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS1109: Expression expected.
(BOOLEAN, );
~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS1109: Expression expected.
(NUMBER, );
~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS1109: Expression expected.
(STRING, );
~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS1109: Expression expected.
(OBJECT, );
~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS1109: Expression expected.
// Missing the first operand
(, ANY);
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS1109: Expression expected.
(, BOOLEAN);
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS1109: Expression expected.
(, NUMBER);
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS1109: Expression expected.
(, STRING);
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS1109: Expression expected.
(, OBJECT);
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS1109: Expression expected.
// Missing all operands
( , );
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS1109: Expression expected.
~
@@ -1,4 +1,5 @@
//// [commaOperatorsMultipleOperators.ts]
var ANY: any;
var BOOLEAN: boolean;
var NUMBER: number;
@@ -1,94 +1,95 @@
=== tests/cases/conformance/expressions/commaOperator/commaOperatorsMultipleOperators.ts ===
var ANY: any;
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3))
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
var BOOLEAN: boolean;
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
var NUMBER: number;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
var STRING: string;
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
var OBJECT: Object;
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3))
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
//Expected: work well
ANY, BOOLEAN, NUMBER;
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
BOOLEAN, NUMBER, STRING;
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
NUMBER, STRING, OBJECT;
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3))
STRING, OBJECT, ANY;
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3))
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3))
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
OBJECT, ANY, BOOLEAN;
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3))
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
//Results should have the same type as the third operand
var resultIsAny1 = (STRING, OBJECT, ANY);
>resultIsAny1 : Symbol(resultIsAny1, Decl(commaOperatorsMultipleOperators.ts, 14, 3))
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3))
>resultIsAny1 : Symbol(resultIsAny1, Decl(commaOperatorsMultipleOperators.ts, 15, 3))
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3))
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
var resultIsBoolean1 = (OBJECT, ANY, BOOLEAN);
>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(commaOperatorsMultipleOperators.ts, 15, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(commaOperatorsMultipleOperators.ts, 16, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3))
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
var resultIsNumber1 = (ANY, BOOLEAN, NUMBER);
>resultIsNumber1 : Symbol(resultIsNumber1, Decl(commaOperatorsMultipleOperators.ts, 16, 3))
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
>resultIsNumber1 : Symbol(resultIsNumber1, Decl(commaOperatorsMultipleOperators.ts, 17, 3))
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
var resultIsString1 = (BOOLEAN, NUMBER, STRING);
>resultIsString1 : Symbol(resultIsString1, Decl(commaOperatorsMultipleOperators.ts, 17, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
>resultIsString1 : Symbol(resultIsString1, Decl(commaOperatorsMultipleOperators.ts, 18, 3))
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
var resultIsObject1 = (NUMBER, STRING, OBJECT);
>resultIsObject1 : Symbol(resultIsObject1, Decl(commaOperatorsMultipleOperators.ts, 18, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
>resultIsObject1 : Symbol(resultIsObject1, Decl(commaOperatorsMultipleOperators.ts, 19, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3))
//Literal and expression
null, true, 1;
++NUMBER, STRING.charAt(0), new Object();
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --))
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
>charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --))
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
var resultIsNumber2 = (null, true, 1);
>resultIsNumber2 : Symbol(resultIsNumber2, Decl(commaOperatorsMultipleOperators.ts, 24, 3))
>resultIsNumber2 : Symbol(resultIsNumber2, Decl(commaOperatorsMultipleOperators.ts, 25, 3))
var resultIsObject2 = (++NUMBER, STRING.charAt(0), new Object());
>resultIsObject2 : Symbol(resultIsObject2, Decl(commaOperatorsMultipleOperators.ts, 25, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
>resultIsObject2 : Symbol(resultIsObject2, Decl(commaOperatorsMultipleOperators.ts, 26, 3))
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --))
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
>charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --))
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
@@ -1,4 +1,5 @@
=== tests/cases/conformance/expressions/commaOperator/commaOperatorsMultipleOperators.ts ===
var ANY: any;
>ANY : any
@@ -1,4 +1,5 @@
//// [controlFlowIfStatement.ts]
let x: string | number | boolean | RegExp;
let cond: boolean;
@@ -1,112 +1,113 @@
=== tests/cases/conformance/controlFlow/controlFlowIfStatement.ts ===
let x: string | number | boolean | RegExp;
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3))
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3))
>RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
let cond: boolean;
>cond : Symbol(cond, Decl(controlFlowIfStatement.ts, 1, 3))
>cond : Symbol(cond, Decl(controlFlowIfStatement.ts, 2, 3))
x = /a/;
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3))
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3))
if (x /* RegExp */, (x = true)) {
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3))
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3))
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3))
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3))
x; // boolean
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3))
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3))
x = "";
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3))
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3))
}
else {
x; // boolean
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3))
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3))
x = 42;
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3))
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3))
}
x; // string | number
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3))
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3))
function a() {
>a : Symbol(a, Decl(controlFlowIfStatement.ts, 12, 2))
>a : Symbol(a, Decl(controlFlowIfStatement.ts, 13, 2))
let x: string | number;
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 15, 7))
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 16, 7))
if (cond) {
>cond : Symbol(cond, Decl(controlFlowIfStatement.ts, 1, 3))
>cond : Symbol(cond, Decl(controlFlowIfStatement.ts, 2, 3))
x = 42;
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 15, 7))
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 16, 7))
}
else {
x = "";
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 15, 7))
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 16, 7))
return;
}
x; // number
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 15, 7))
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 16, 7))
}
function b() {
>b : Symbol(b, Decl(controlFlowIfStatement.ts, 24, 1))
>b : Symbol(b, Decl(controlFlowIfStatement.ts, 25, 1))
let x: string | number;
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 26, 7))
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 27, 7))
if (cond) {
>cond : Symbol(cond, Decl(controlFlowIfStatement.ts, 1, 3))
>cond : Symbol(cond, Decl(controlFlowIfStatement.ts, 2, 3))
x = 42;
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 26, 7))
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 27, 7))
throw "";
}
else {
x = "";
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 26, 7))
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 27, 7))
}
x; // string
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 26, 7))
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 27, 7))
}
function c<T>(data: string | T): T {
>c : Symbol(c, Decl(controlFlowIfStatement.ts, 35, 1))
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 36, 11))
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 36, 14))
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 36, 11))
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 36, 11))
>c : Symbol(c, Decl(controlFlowIfStatement.ts, 36, 1))
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 37, 11))
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 37, 14))
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 37, 11))
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 37, 11))
if (typeof data === 'string') {
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 36, 14))
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 37, 14))
return JSON.parse(data);
>JSON.parse : Symbol(JSON.parse, Decl(lib.d.ts, --, --))
>JSON : Symbol(JSON, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
>parse : Symbol(JSON.parse, Decl(lib.d.ts, --, --))
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 36, 14))
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 37, 14))
}
else {
return data;
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 36, 14))
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 37, 14))
}
}
function d<T extends string>(data: string | T): never {
>d : Symbol(d, Decl(controlFlowIfStatement.ts, 43, 1))
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 44, 11))
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 44, 29))
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 44, 11))
>d : Symbol(d, Decl(controlFlowIfStatement.ts, 44, 1))
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 45, 11))
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 45, 29))
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 45, 11))
if (typeof data === 'string') {
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 44, 29))
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 45, 29))
throw new Error('will always happen');
>Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
}
else {
return data;
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 44, 29))
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 45, 29))
}
}
@@ -1,4 +1,5 @@
=== tests/cases/conformance/controlFlow/controlFlowIfStatement.ts ===
let x: string | number | boolean | RegExp;
>x : string | number | boolean | RegExp
>RegExp : RegExp
@@ -1,7 +1,9 @@
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(7,18): error TS1005: ':' expected.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,14): error TS1181: Array element destructuring pattern expected.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,19): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,19): error TS1005: '(' expected.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,21): error TS1109: Expression expected.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,24): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,24): error TS1005: '(' expected.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,26): error TS2304: Cannot find name 'public'.
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,32): error TS1005: ';' expected.
@@ -11,7 +13,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(12,13): error TS2370: A rest parameter must be of an array type.
==== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts (11 errors) ====
==== tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts (13 errors) ====
// A parameter declaration may specify either an identifier or a binding pattern.
// Reserved words are not allowed to be used as an identifier in parameter declaration
@@ -25,10 +27,14 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(
function a4([while, for, public]){ }
~~~~~
!!! error TS1181: Array element destructuring pattern expected.
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS1005: '(' expected.
~~~
!!! error TS1109: Expression expected.
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS1005: '(' expected.
~~~~~~
@@ -1,10 +1,14 @@
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,12): error TS2304: Cannot find name 'a'.
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,12): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,16): error TS2304: Cannot find name 'b'.
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,16): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,19): error TS2304: Cannot find name 'c'.
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,23): error TS1005: ';' expected.
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,26): error TS2304: Cannot find name 'a'.
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,28): error TS2304: Cannot find name 'b'.
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,30): error TS2304: Cannot find name 'c'.
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,12): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,12): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,13): error TS2304: Cannot find name 'a'.
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,17): error TS2304: Cannot find name 'b'.
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,20): error TS2304: Cannot find name 'c'.
@@ -17,12 +21,16 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,17): error TS1005
tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,20): error TS2304: Cannot find name 'a'.
==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts (17 errors) ====
==== tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts (21 errors) ====
var tt1 = (a, (b, c)) => a+b+c;
~
!!! error TS2304: Cannot find name 'a'.
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS2304: Cannot find name 'b'.
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS2304: Cannot find name 'c'.
~~
@@ -34,6 +42,10 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,20): error TS2304
~
!!! error TS2304: Cannot find name 'c'.
var tt2 = ((a), b, c) => a+b+c;
~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS2304: Cannot find name 'a'.
~
@@ -1,4 +1,5 @@
//// [inferentialTypingWithFunctionTypeSyntacticScenarios.ts]
declare function map<T, U>(array: T, func: (x: T) => U): U;
declare function identity<V>(y: V): V;
var s: string;
@@ -1,94 +1,95 @@
=== tests/cases/compiler/inferentialTypingWithFunctionTypeSyntacticScenarios.ts ===
declare function map<T, U>(array: T, func: (x: T) => U): U;
>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0))
>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 21))
>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 23))
>array : Symbol(array, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 27))
>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 21))
>func : Symbol(func, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 36))
>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 44))
>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 21))
>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 23))
>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 23))
>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 21))
>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 23))
>array : Symbol(array, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 27))
>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 21))
>func : Symbol(func, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 36))
>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 44))
>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 21))
>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 23))
>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 23))
declare function identity<V>(y: V): V;
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59))
>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 26))
>y : Symbol(y, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 29))
>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 26))
>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 26))
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59))
>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 26))
>y : Symbol(y, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 29))
>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 26))
>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 26))
var s: string;
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3))
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3))
// dotted name
var dottedIdentity = { x: identity };
>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 3))
>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22))
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59))
>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 3))
>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 22))
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59))
s = map("", dottedIdentity.x);
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3))
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3))
>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0))
>dottedIdentity.x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22))
>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 3))
>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22))
>dottedIdentity.x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 22))
>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 3))
>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 22))
// index expression
s = map("", dottedIdentity['x']);
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3))
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3))
>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0))
>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 3))
>'x' : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22))
>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 3))
>'x' : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 22))
// function call
s = map("", (() => identity)());
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3))
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3))
>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0))
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59))
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59))
// construct
interface IdentityConstructor {
>IdentityConstructor : Symbol(IdentityConstructor, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 12, 32))
>IdentityConstructor : Symbol(IdentityConstructor, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 13, 32))
new (): typeof identity;
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59))
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59))
}
var ic: IdentityConstructor;
>ic : Symbol(ic, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 18, 3))
>IdentityConstructor : Symbol(IdentityConstructor, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 12, 32))
>ic : Symbol(ic, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 19, 3))
>IdentityConstructor : Symbol(IdentityConstructor, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 13, 32))
s = map("", new ic());
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3))
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3))
>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0))
>ic : Symbol(ic, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 18, 3))
>ic : Symbol(ic, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 19, 3))
// assignment
var t;
>t : Symbol(t, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 22, 3))
>t : Symbol(t, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 23, 3))
s = map("", t = identity);
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3))
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3))
>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0))
>t : Symbol(t, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 22, 3))
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59))
>t : Symbol(t, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 23, 3))
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59))
// type assertion
s = map("", <typeof identity>identity);
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3))
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3))
>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0))
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59))
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59))
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59))
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59))
// parenthesized expression
s = map("", (identity));
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3))
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3))
>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0))
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59))
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59))
// comma
s = map("", ("", identity));
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3))
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3))
>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0))
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59))
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59))
@@ -1,4 +1,5 @@
=== tests/cases/compiler/inferentialTypingWithFunctionTypeSyntacticScenarios.ts ===
declare function map<T, U>(array: T, func: (x: T) => U): U;
>map : <T, U>(array: T, func: (x: T) => U) => U
>T : T
@@ -1,3 +1,4 @@
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(39,1): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(39,17): error TS1005: '{' expected.
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(39,23): error TS1005: '}' expected.
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(39,29): error TS1005: '{' expected.
@@ -7,7 +8,7 @@ tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(41,1): error TS1003: Ident
tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(41,12): error TS2657: JSX expressions must have one parent element
==== tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx (7 errors) ====
==== tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx (8 errors) ====
declare var React: any;
declare var 日本語;
declare var AbC_def;
@@ -47,6 +48,8 @@ tests/cases/conformance/jsx/jsxEsprimaFbTestSuite.tsx(41,12): error TS2657: JSX
<div><br />7x invalid-js-identifier</div>;
<LeftRight left=<a /> right=<b>monkeys /> gorillas</b> />;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS1005: '{' expected.
~~~~~
@@ -7,6 +7,7 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(5,2): error TS1109: E
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(5,3): error TS2304: Cannot find name 'a'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(5,6): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(5,7): error TS1109: Expression expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(6,1): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(6,6): error TS1005: '{' expected.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(6,6): error TS2304: Cannot find name 'd'.
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(6,9): error TS1109: Expression expected.
@@ -69,7 +70,7 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,4): error TS1003:
tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005: '</' expected.
==== tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx (69 errors) ====
==== tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx (70 errors) ====
declare var React: any;
</>;
@@ -94,6 +95,8 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005:
~
!!! error TS1109: Expression expected.
<a b=d />;
~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS1005: '{' expected.
~
@@ -1,9 +1,10 @@
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(45,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(46,27): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'.
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(47,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(57,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts (3 errors) ====
==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts (4 errors) ====
// ! operator on any type
var ANY: any;
@@ -67,5 +68,7 @@ tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNot
!ANY1;
!ANY2[0];
!ANY, ANY1;
~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
!objA.a;
!M.n;
@@ -0,0 +1,44 @@
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithBooleanType.ts(36,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithBooleanType.ts (1 errors) ====
// ! operator on boolean type
var BOOLEAN: boolean;
function foo(): boolean { return true; }
class A {
public a: boolean;
static foo() { return false; }
}
module M {
export var n: boolean;
}
var objA = new A();
// boolean type var
var ResultIsBoolean1 = !BOOLEAN;
// boolean type literal
var ResultIsBoolean2 = !true;
var ResultIsBoolean3 = !{ x: true, y: false };
// boolean type expressions
var ResultIsBoolean4 = !objA.a;
var ResultIsBoolean5 = !M.n;
var ResultIsBoolean6 = !foo();
var ResultIsBoolean7 = !A.foo();
// multiple ! operators
var ResultIsBoolean = !!BOOLEAN;
// miss assignment operators
!true;
!BOOLEAN;
!foo();
!true, false;
~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
!objA.a;
!M.n;
@@ -0,0 +1,27 @@
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithEnumType.ts(21,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithEnumType.ts (1 errors) ====
// ! operator on enum type
enum ENUM { A, B, C };
enum ENUM1 { };
// enum type var
var ResultIsBoolean1 = !ENUM;
// enum type expressions
var ResultIsBoolean2 = !ENUM["B"];
var ResultIsBoolean3 = !(ENUM.B + ENUM["C"]);
// multiple ! operators
var ResultIsBoolean4 = !!ENUM;
var ResultIsBoolean5 = !!!(ENUM["B"] + ENUM.C);
// miss assignment operators
!ENUM;
!ENUM1;
!ENUM.B;
!ENUM, ENUM1;
~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
@@ -0,0 +1,51 @@
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithNumberType.ts(45,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithNumberType.ts (1 errors) ====
// ! operator on number type
var NUMBER: number;
var NUMBER1: number[] = [1, 2];
function foo(): number { return 1; }
class A {
public a: number;
static foo() { return 1; }
}
module M {
export var n: number;
}
var objA = new A();
// number type var
var ResultIsBoolean1 = !NUMBER;
var ResultIsBoolean2 = !NUMBER1;
// number type literal
var ResultIsBoolean3 = !1;
var ResultIsBoolean4 = !{ x: 1, y: 2};
var ResultIsBoolean5 = !{ x: 1, y: (n: number) => { return n; } };
// number type expressions
var ResultIsBoolean6 = !objA.a;
var ResultIsBoolean7 = !M.n;
var ResultIsBoolean8 = !NUMBER1[0];
var ResultIsBoolean9 = !foo();
var ResultIsBoolean10 = !A.foo();
var ResultIsBoolean11 = !(NUMBER + NUMBER);
// multiple ! operator
var ResultIsBoolean12 = !!NUMBER;
var ResultIsBoolean13 = !!!(NUMBER + NUMBER);
// miss assignment operators
!1;
!NUMBER;
!NUMBER1;
!foo();
!objA.a;
!M.n;
!objA.a, M.n;
~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
@@ -0,0 +1,50 @@
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithStringType.ts(44,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithStringType.ts (1 errors) ====
// ! operator on string type
var STRING: string;
var STRING1: string[] = ["", "abc"];
function foo(): string { return "abc"; }
class A {
public a: string;
static foo() { return ""; }
}
module M {
export var n: string;
}
var objA = new A();
// string type var
var ResultIsBoolean1 = !STRING;
var ResultIsBoolean2 = !STRING1;
// string type literal
var ResultIsBoolean3 = !"";
var ResultIsBoolean4 = !{ x: "", y: "" };
var ResultIsBoolean5 = !{ x: "", y: (s: string) => { return s; } };
// string type expressions
var ResultIsBoolean6 = !objA.a;
var ResultIsBoolean7 = !M.n;
var ResultIsBoolean8 = !STRING1[0];
var ResultIsBoolean9 = !foo();
var ResultIsBoolean10 = !A.foo();
var ResultIsBoolean11 = !(STRING + STRING);
var ResultIsBoolean12 = !STRING.charAt(0);
// multiple ! operator
var ResultIsBoolean13 = !!STRING;
var ResultIsBoolean14 = !!!(STRING + STRING);
// miss assignment operators
!"";
!STRING;
!STRING1;
!foo();
!objA.a,M.n;
~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
@@ -0,0 +1,59 @@
tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts(51,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts (1 errors) ====
// - operator on any type
var ANY: any;
var ANY1;
var ANY2: any[] = ["", ""];
var obj: () => {}
var obj1 = { x: "", y: () => { }};
function foo(): any {
var a;
return a;
}
class A {
public a: any;
static foo() {
var a;
return a;
}
}
module M {
export var n: any;
}
var objA = new A();
// any type var
var ResultIsNumber1 = -ANY1;
var ResultIsNumber2 = -ANY2;
var ResultIsNumber3 = -A;
var ResultIsNumber4 = -M;
var ResultIsNumber5 = -obj;
var ResultIsNumber6 = -obj1;
// any type literal
var ResultIsNumber7 = -undefined;
var ResultIsNumber = -null;
// any type expressions
var ResultIsNumber8 = -ANY2[0];
var ResultIsNumber9 = -obj1.x;
var ResultIsNumber10 = -obj1.y;
var ResultIsNumber11 = -objA.a;
var ResultIsNumber12 = -M.n;
var ResultIsNumber13 = -foo();
var ResultIsNumber14 = -A.foo();
var ResultIsNumber15 = -(ANY - ANY1);
// miss assignment operators
-ANY;
-ANY1;
-ANY2[0];
-ANY, ANY1;
~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
-objA.a;
-M.n;
@@ -0,0 +1,41 @@
tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithBooleanType.ts(33,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithBooleanType.ts (1 errors) ====
// - operator on boolean type
var BOOLEAN: boolean;
function foo(): boolean { return true; }
class A {
public a: boolean;
static foo() { return false; }
}
module M {
export var n: boolean;
}
var objA = new A();
// boolean type var
var ResultIsNumber1 = -BOOLEAN;
// boolean type literal
var ResultIsNumber2 = -true;
var ResultIsNumber3 = -{ x: true, y: false };
// boolean type expressions
var ResultIsNumber4 = -objA.a;
var ResultIsNumber5 = -M.n;
var ResultIsNumber6 = -foo();
var ResultIsNumber7 = -A.foo();
// miss assignment operators
-true;
-BOOLEAN;
-foo();
-true, false;
~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
-objA.a;
-M.n;
@@ -0,0 +1,23 @@
tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithEnumType.ts(17,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithEnumType.ts (1 errors) ====
// - operator on enum type
enum ENUM { };
enum ENUM1 { A, B, "" };
// enum type var
var ResultIsNumber1 = -ENUM;
// expressions
var ResultIsNumber2 = -ENUM1["B"];
var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]);
// miss assignment operators
-ENUM;
-ENUM1;
-ENUM1["B"];
-ENUM, ENUM1;
~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
@@ -0,0 +1,47 @@
tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithNumberType.ts(41,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithNumberType.ts (1 errors) ====
// - operator on number type
var NUMBER: number;
var NUMBER1: number[] = [1, 2];
function foo(): number { return 1; }
class A {
public a: number;
static foo() { return 1; }
}
module M {
export var n: number;
}
var objA = new A();
// number type var
var ResultIsNumber1 = -NUMBER;
var ResultIsNumber2 = -NUMBER1;
// number type literal
var ResultIsNumber3 = -1;
var ResultIsNumber4 = -{ x: 1, y: 2};
var ResultIsNumber5 = -{ x: 1, y: (n: number) => { return n; } };
// number type expressions
var ResultIsNumber6 = -objA.a;
var ResultIsNumber7 = -M.n;
var ResultIsNumber8 = -NUMBER1[0];
var ResultIsNumber9 = -foo();
var ResultIsNumber10 = -A.foo();
var ResultIsNumber11 = -(NUMBER - NUMBER);
// miss assignment operators
-1;
-NUMBER;
-NUMBER1;
-foo();
-objA.a;
-M.n;
-objA.a, M.n;
~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
@@ -0,0 +1,46 @@
tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithStringType.ts(40,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithStringType.ts (1 errors) ====
// - operator on string type
var STRING: string;
var STRING1: string[] = ["", "abc"];
function foo(): string { return "abc"; }
class A {
public a: string;
static foo() { return ""; }
}
module M {
export var n: string;
}
var objA = new A();
// string type var
var ResultIsNumber1 = -STRING;
var ResultIsNumber2 = -STRING1;
// string type literal
var ResultIsNumber3 = -"";
var ResultIsNumber4 = -{ x: "", y: "" };
var ResultIsNumber5 = -{ x: "", y: (s: string) => { return s; } };
// string type expressions
var ResultIsNumber6 = -objA.a;
var ResultIsNumber7 = -M.n;
var ResultIsNumber8 = -STRING1[0];
var ResultIsNumber9 = -foo();
var ResultIsNumber10 = -A.foo();
var ResultIsNumber11 = -(STRING + STRING);
var ResultIsNumber12 = -STRING.charAt(0);
// miss assignment operators
-"";
-STRING;
-STRING1;
-foo();
-objA.a,M.n;
~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
@@ -1,9 +1,10 @@
tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(27,16): error TS1005: ',' expected.
tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(27,16): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(32,23): error TS1005: '(' expected.
tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(37,9): error TS2350: Only a void function can be called with the 'new' keyword.
==== tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts (3 errors) ====
==== tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts (4 errors) ====
class C0 {
@@ -33,6 +34,8 @@ tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(37,9):
var b = new C0 32, ''; // Parse error
~~
!!! error TS1005: ',' expected.
~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
// Generic construct expression with no parentheses
var c1 = new T;
@@ -0,0 +1,44 @@
tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(28,32): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(28,56): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(29,33): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(29,57): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts (4 errors) ====
function fun<T>(g: (x: T) => T, x: T): T;
function fun<T>(g: (x: T) => T, h: (y: T) => T, x: T): T;
function fun<T>(g: (x: T) => T, x: T): T {
return g(x);
}
var a = fun(x => x, 10);
var b = fun((x => x), 10);
var c = fun(((x => x)), 10);
var d = fun((((x => x))), 10);
var e = fun(x => x, x => x, 10);
var f = fun((x => x), (x => x), 10);
var g = fun(((x => x)), ((x => x)), 10);
var h = fun((((x => x))), ((x => x)), 10);
// Ternaries in parens
var i = fun((Math.random() < 0.5 ? x => x : x => undefined), 10);
var j = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), 10);
var k = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), x => x, 10);
var l = fun(((Math.random() < 0.5 ? ((x => x)) : ((x => undefined)))), ((x => x)), 10);
var lambda1: (x: number) => number = x => x;
var lambda2: (x: number) => number = (x => x);
type ObjType = { x: (p: number) => string; y: (p: string) => number };
var obj1: ObjType = { x: x => (x, undefined), y: y => (y, undefined) };
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
var obj2: ObjType = ({ x: x => (x, undefined), y: y => (y, undefined) });
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
@@ -0,0 +1,51 @@
tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(35,32): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(35,56): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(36,33): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(36,57): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts (4 errors) ====
// These tests ensure that in cases where it may *appear* that a value has a type,
// they actually are properly being contextually typed. The way we test this is
// that we invoke contextually typed arguments with type arguments.
// Since 'any' cannot be invoked with type arguments, we should get errors
// back if contextual typing is not taking effect.
type FuncType = (x: <T>(p: T) => T) => typeof x;
function fun<T>(f: FuncType, x: T): T;
function fun<T>(f: FuncType, g: FuncType, x: T): T;
function fun<T>(...rest: any[]): T {
return undefined;
}
var a = fun(x => { x<number>(undefined); return x; }, 10);
var b = fun((x => { x<number>(undefined); return x; }), 10);
var c = fun(((x => { x<number>(undefined); return x; })), 10);
var d = fun((((x => { x<number>(undefined); return x; }))), 10);
var e = fun(x => { x<number>(undefined); return x; }, x => { x<number>(undefined); return x; }, 10);
var f = fun((x => { x<number>(undefined); return x; }),(x => { x<number>(undefined); return x; }), 10);
var g = fun(((x => { x<number>(undefined); return x; })),((x => { x<number>(undefined); return x; })), 10);
var h = fun((((x => { x<number>(undefined); return x; }))),((x => { x<number>(undefined); return x; })), 10);
// Ternaries in parens
var i = fun((Math.random() < 0.5 ? x => { x<number>(undefined); return x; } : x => undefined), 10);
var j = fun((Math.random() < 0.5 ? (x => { x<number>(undefined); return x; }) : (x => undefined)), 10);
var k = fun((Math.random() < 0.5 ? (x => { x<number>(undefined); return x; }) : (x => undefined)), x => { x<number>(undefined); return x; }, 10);
var l = fun(((Math.random() < 0.5 ? ((x => { x<number>(undefined); return x; })) : ((x => undefined)))),((x => { x<number>(undefined); return x; })), 10);
var lambda1: FuncType = x => { x<number>(undefined); return x; };
var lambda2: FuncType = (x => { x<number>(undefined); return x; });
type ObjType = { x: (p: number) => string; y: (p: string) => number };
var obj1: ObjType = { x: x => (x, undefined), y: y => (y, undefined) };
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
var obj2: ObjType = ({ x: x => (x, undefined), y: y => (y, undefined) });
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
@@ -1,5 +1,7 @@
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,11): error TS2304: Cannot find name 'a'.
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,11): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,15): error TS2304: Cannot find name 'b'.
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,15): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,18): error TS2304: Cannot find name 'c'.
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,22): error TS1005: ';' expected.
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,25): error TS2304: Cannot find name 'a'.
@@ -7,12 +9,16 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,27)
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,29): error TS2304: Cannot find name 'c'.
==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts (7 errors) ====
==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts (9 errors) ====
var tt = (a, (b, c)) => a+b+c;
~
!!! error TS2304: Cannot find name 'a'.
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS2304: Cannot find name 'b'.
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS2304: Cannot find name 'c'.
~~
@@ -1,10 +1,13 @@
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts(1,1): error TS2304: Cannot find name 'a'.
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts(1,6): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts(1,17): error TS2304: Cannot find name 'a'.
==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts (2 errors) ====
==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts (3 errors) ====
a = (() => { }, a)
~
!!! error TS2304: Cannot find name 'a'.
~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS2304: Cannot find name 'a'.
@@ -7,13 +7,14 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunctio
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(8,13): error TS2304: Cannot find name 'a'.
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(9,10): error TS2304: Cannot find name 'T'.
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(9,13): error TS2304: Cannot find name 'a'.
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(9,13): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(9,16): error TS2304: Cannot find name 'b'.
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(10,10): error TS2304: Cannot find name 'T'.
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(10,13): error TS2304: Cannot find name 'a'.
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(10,20): error TS2304: Cannot find name 'b'.
==== tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts (13 errors) ====
==== tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts (14 errors) ====
var v = <T>() => 1;
var v = <T>a;
~
@@ -41,6 +42,8 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunctio
!!! error TS2304: Cannot find name 'T'.
~
!!! error TS2304: Cannot find name 'a'.
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS2304: Cannot find name 'b'.
var v = <T>(a = 1, b = 2);
@@ -1,9 +1,12 @@
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts(2,6): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts(2,6): error TS1171: A comma expression is not allowed in a computed property name.
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts (1 errors) ====
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts (2 errors) ====
var x = {
[0, 1]: { }
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~~~~
!!! error TS1171: A comma expression is not allowed in a computed property name.
}
@@ -1,12 +1,18 @@
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts(2,54): error TS1005: ',' expected.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts(2,56): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts(2,56): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts(2,105): error TS1005: ';' expected.
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts (2 errors) ====
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts (4 errors) ====
var texCoords = [2, 2, 0.5000001192092895, 0.8749999 ; 403953552, 0.5000001192092895, 0.8749999403953552];
~
!!! error TS1005: ',' expected.
~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS1005: ';' expected.
@@ -1,12 +1,15 @@
tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts(1,1): error TS2304: Cannot find name 'b'.
tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts(1,1): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts(1,16): error TS2304: Cannot find name 'c'.
tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts(1,21): error TS2304: Cannot find name 'd'.
==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts (3 errors) ====
==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts (4 errors) ====
b.src ? 1 : 2, c && d;
~
!!! error TS2304: Cannot find name 'b'.
~~~~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS2304: Cannot find name 'c'.
~
@@ -1,9 +1,10 @@
tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(46,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(47,26): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'.
tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(48,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(54,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts (3 errors) ====
==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts (4 errors) ====
// + operator on any type
var ANY: any;
@@ -64,5 +65,7 @@ tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWith
+ANY1;
+ANY2[0];
+ANY, ANY1;
~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
+objA.a;
+M.n;
@@ -0,0 +1,41 @@
tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithBooleanType.ts(33,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithBooleanType.ts (1 errors) ====
// + operator on boolean type
var BOOLEAN: boolean;
function foo(): boolean { return true; }
class A {
public a: boolean;
static foo() { return false; }
}
module M {
export var n: boolean;
}
var objA = new A();
// boolean type var
var ResultIsNumber1 = +BOOLEAN;
// boolean type literal
var ResultIsNumber2 = +true;
var ResultIsNumber3 = +{ x: true, y: false };
// boolean type expressions
var ResultIsNumber4 = +objA.a;
var ResultIsNumber5 = +M.n;
var ResultIsNumber6 = +foo();
var ResultIsNumber7 = +A.foo();
// miss assignment operators
+true;
+BOOLEAN;
+foo();
+true, false;
~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
+objA.a;
+M.n;
@@ -0,0 +1,24 @@
tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithEnumType.ts(18,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithEnumType.ts (1 errors) ====
// + operator on enum type
enum ENUM { };
enum ENUM1 { A, B, "" };
// enum type var
var ResultIsNumber1 = +ENUM;
var ResultIsNumber2 = +ENUM1;
// enum type expressions
var ResultIsNumber3 = +ENUM1["A"];
var ResultIsNumber4 = +(ENUM[0] + ENUM1["B"]);
// miss assignment operators
+ENUM;
+ENUM1;
+ENUM1.B;
+ENUM, ENUM1;
~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
@@ -0,0 +1,47 @@
tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithNumberType.ts(41,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithNumberType.ts (1 errors) ====
// + operator on number type
var NUMBER: number;
var NUMBER1: number[] = [1, 2];
function foo(): number { return 1; }
class A {
public a: number;
static foo() { return 1; }
}
module M {
export var n: number;
}
var objA = new A();
// number type var
var ResultIsNumber1 = +NUMBER;
var ResultIsNumber2 = +NUMBER1;
// number type literal
var ResultIsNumber3 = +1;
var ResultIsNumber4 = +{ x: 1, y: 2};
var ResultIsNumber5 = +{ x: 1, y: (n: number) => { return n; } };
// number type expressions
var ResultIsNumber6 = +objA.a;
var ResultIsNumber7 = +M.n;
var ResultIsNumber8 = +NUMBER1[0];
var ResultIsNumber9 = +foo();
var ResultIsNumber10 = +A.foo();
var ResultIsNumber11 = +(NUMBER + NUMBER);
// miss assignment operators
+1;
+NUMBER;
+NUMBER1;
+foo();
+objA.a;
+M.n;
+objA.a, M.n;
~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
@@ -0,0 +1,46 @@
tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithStringType.ts(40,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithStringType.ts (1 errors) ====
// + operator on string type
var STRING: string;
var STRING1: string[] = ["", "abc"];
function foo(): string { return "abc"; }
class A {
public a: string;
static foo() { return ""; }
}
module M {
export var n: string;
}
var objA = new A();
// string type var
var ResultIsNumber1 = +STRING;
var ResultIsNumber2 = +STRING1;
// string type literal
var ResultIsNumber3 = +"";
var ResultIsNumber4 = +{ x: "", y: "" };
var ResultIsNumber5 = +{ x: "", y: (s: string) => { return s; } };
// string type expressions
var ResultIsNumber6 = +objA.a;
var ResultIsNumber7 = +M.n;
var ResultIsNumber8 = +STRING1[0];
var ResultIsNumber9 = +foo();
var ResultIsNumber10 = +A.foo();
var ResultIsNumber11 = +(STRING + STRING);
var ResultIsNumber12 = +STRING.charAt(0);
// miss assignment operators
+"";
+STRING;
+STRING1;
+foo();
+objA.a,M.n;
~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
@@ -1,9 +1,10 @@
tests/cases/compiler/sourceMapValidationFor.ts(2,5): error TS2304: Cannot find name 'WScript'.
tests/cases/compiler/sourceMapValidationFor.ts(6,5): error TS2304: Cannot find name 'WScript'.
tests/cases/compiler/sourceMapValidationFor.ts(20,1): error TS7027: Unreachable code detected.
tests/cases/compiler/sourceMapValidationFor.ts(32,21): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/compiler/sourceMapValidationFor.ts (3 errors) ====
==== tests/cases/compiler/sourceMapValidationFor.ts (4 errors) ====
for (var i = 0; i < 10; i++) {
WScript.Echo("i: " + i);
~~~~~~~
@@ -42,4 +43,6 @@ tests/cases/compiler/sourceMapValidationFor.ts(20,1): error TS7027: Unreachable
i++;
}
for (i = 0, j = 20; j < 20, i < 20; j++) {
~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
}
@@ -2,6 +2,8 @@ tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(10
Type '"baz"' is not comparable to type '"foo"'.
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(12,10): error TS2678: Type '"bar"' is not comparable to type '"foo"'.
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(14,10): error TS2678: Type '"baz"' is not comparable to type '"foo"'.
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(14,11): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(14,11): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(20,10): error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'.
Type '"baz"' is not comparable to type '"foo"'.
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(22,10): error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'.
@@ -10,7 +12,7 @@ tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(23
Type '"baz"' is not comparable to type '"foo"'.
==== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts (6 errors) ====
==== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts (8 errors) ====
let x: "foo";
let y: "foo" | "bar";
let z: "bar";
@@ -32,6 +34,10 @@ tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(23
case (x, y, ("baz")):
~~~~~~~~~~~~~~~
!!! error TS2678: Type '"baz"' is not comparable to type '"foo"'.
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
x;
y;
break;
@@ -1,7 +1,11 @@
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(7,10): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(9,10): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(11,10): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(11,10): error TS2678: Type '"baz"' is not comparable to type '"foo" | "bar"'.
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(13,10): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts (1 errors) ====
==== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts (5 errors) ====
let x: "foo";
let y: "foo" | "bar";
@@ -9,14 +13,22 @@ tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(11
switch (y) {
case "foo", x:
~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
break;
case x, "foo":
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
break;
case x, "baz":
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~~~~~~~~
!!! error TS2678: Type '"baz"' is not comparable to type '"foo" | "bar"'.
break;
case "baz", x:
~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
break;
case "baz" && "bar":
break;
@@ -4,9 +4,13 @@ tests/cases/compiler/systemModule16.ts(4,15): error TS2307: Cannot find module '
tests/cases/compiler/systemModule16.ts(5,15): error TS2307: Cannot find module 'bar'.
tests/cases/compiler/systemModule16.ts(8,32): error TS2307: Cannot find module 'foo'.
tests/cases/compiler/systemModule16.ts(9,32): error TS2307: Cannot find module 'bar'.
tests/cases/compiler/systemModule16.ts(11,1): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/systemModule16.ts(11,1): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/systemModule16.ts(11,1): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/systemModule16.ts(11,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/compiler/systemModule16.ts (6 errors) ====
==== tests/cases/compiler/systemModule16.ts (10 errors) ====
import * as x from "foo";
~~~~~
@@ -30,4 +34,12 @@ tests/cases/compiler/systemModule16.ts(9,32): error TS2307: Cannot find module '
!!! error TS2307: Cannot find module 'bar'.
x,y,a1,b1,d1;
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
@@ -0,0 +1,56 @@
tests/cases/conformance/jsx/file.tsx(19,2): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/jsx/file.tsx(23,3): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/jsx/file.tsx(26,3): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/jsx/file.tsx(39,2): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/jsx/file.tsx (4 errors) ====
declare module JSX {
interface Element { }
interface IntrinsicElements { }
}
module M {
export class Foo { constructor() { } }
export module S {
export class Bar { }
// Emit Foo
// Foo, <Foo />;
}
}
module M {
// Emit M.Foo
Foo, <Foo />;
~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
export module S {
// Emit M.Foo
Foo, <Foo />;
~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
// Emit S.Bar
Bar, <Bar />;
~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
}
}
module M {
// Emit M.S.Bar
S.Bar, <S.Bar />;
}
module M {
var M = 100;
// Emit M_1.Foo
Foo, <Foo />;
~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
}
@@ -1,18 +1,24 @@
tests/cases/conformance/jsx/file1.tsx(4,1): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/jsx/file1.tsx(6,1): error TS2657: JSX expressions must have one parent element
tests/cases/conformance/jsx/file2.tsx(1,9): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/jsx/file2.tsx(2,1): error TS2657: JSX expressions must have one parent element
==== tests/cases/conformance/jsx/file1.tsx (1 errors) ====
==== tests/cases/conformance/jsx/file1.tsx (2 errors) ====
declare namespace JSX { interface Element { } }
<div></div>
~~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
<div></div>
!!! error TS2657: JSX expressions must have one parent element
==== tests/cases/conformance/jsx/file2.tsx (1 errors) ====
==== tests/cases/conformance/jsx/file2.tsx (2 errors) ====
var x = <div></div><div></div>
~~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
!!! error TS2657: JSX expressions must have one parent element
@@ -1,16 +1,20 @@
tests/cases/conformance/jsx/file1.tsx(4,1): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/jsx/file1.tsx(4,2): error TS2304: Cannot find name 'React'.
tests/cases/conformance/jsx/file1.tsx(5,2): error TS2304: Cannot find name 'React'.
tests/cases/conformance/jsx/file1.tsx(6,1): error TS2657: JSX expressions must have one parent element
tests/cases/conformance/jsx/file2.tsx(1,9): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/jsx/file2.tsx(1,10): error TS2304: Cannot find name 'React'.
tests/cases/conformance/jsx/file2.tsx(1,21): error TS2304: Cannot find name 'React'.
tests/cases/conformance/jsx/file2.tsx(2,1): error TS2657: JSX expressions must have one parent element
==== tests/cases/conformance/jsx/file1.tsx (3 errors) ====
==== tests/cases/conformance/jsx/file1.tsx (4 errors) ====
declare namespace JSX { interface Element { } }
<div></div>
~~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~~~
!!! error TS2304: Cannot find name 'React'.
<div></div>
@@ -19,8 +23,10 @@ tests/cases/conformance/jsx/file2.tsx(2,1): error TS2657: JSX expressions must h
!!! error TS2657: JSX expressions must have one parent element
==== tests/cases/conformance/jsx/file2.tsx (3 errors) ====
==== tests/cases/conformance/jsx/file2.tsx (4 errors) ====
var x = <div></div><div></div>
~~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~~~
!!! error TS2304: Cannot find name 'React'.
~~~
@@ -1,10 +1,13 @@
tests/cases/compiler/typecheckCommaExpression.ts(1,2): error TS2304: Cannot find name 'a'.
tests/cases/compiler/typecheckCommaExpression.ts(1,2): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/typecheckCommaExpression.ts(1,5): error TS2304: Cannot find name 'b'.
==== tests/cases/compiler/typecheckCommaExpression.ts (2 errors) ====
==== tests/cases/compiler/typecheckCommaExpression.ts (3 errors) ====
(a, b)
~
!!! error TS2304: Cannot find name 'a'.
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~
!!! error TS2304: Cannot find name 'b'.
@@ -1,6 +1,7 @@
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(46,32): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(47,32): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'.
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(48,32): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(58,1): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(68,1): error TS7028: Unused label.
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(69,1): error TS7028: Unused label.
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(70,1): error TS7028: Unused label.
@@ -10,7 +11,7 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(74,1): error TS7028: Unused label.
==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts (10 errors) ====
==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts (11 errors) ====
// typeof operator on any type
var ANY: any;
@@ -75,6 +76,8 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator
typeof ANY1;
typeof ANY2[0];
typeof ANY, ANY1;
~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
typeof obj1;
typeof obj1.x;
typeof objA.a;
@@ -0,0 +1,57 @@
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts(37,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts (1 errors) ====
// typeof operator on boolean type
var BOOLEAN: boolean;
function foo(): boolean { return true; }
class A {
public a: boolean;
static foo() { return false; }
}
module M {
export var n: boolean;
}
var objA = new A();
// boolean type var
var ResultIsString1 = typeof BOOLEAN;
// boolean type literal
var ResultIsString2 = typeof true;
var ResultIsString3 = typeof { x: true, y: false };
// boolean type expressions
var ResultIsString4 = typeof objA.a;
var ResultIsString5 = typeof M.n;
var ResultIsString6 = typeof foo();
var ResultIsString7 = typeof A.foo();
// multiple typeof operator
var ResultIsString8 = typeof typeof BOOLEAN;
// miss assignment operators
typeof true;
typeof BOOLEAN;
typeof foo();
typeof true, false;
~~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
typeof objA.a;
typeof M.n;
// use typeof in type query
var z: boolean;
var x: boolean[];
var r: () => boolean;
z: typeof BOOLEAN;
r: typeof foo;
var y = { a: true, b: false};
z: typeof y.a;
z: typeof objA.a;
z: typeof A.foo;
z: typeof M.n;
@@ -0,0 +1,34 @@
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts(23,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts (1 errors) ====
// typeof operator on enum type
enum ENUM { };
enum ENUM1 { A, B, "" };
// enum type var
var ResultIsString1 = typeof ENUM;
var ResultIsString2 = typeof ENUM1;
// enum type expressions
var ResultIsString3 = typeof ENUM1["A"];
var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]);
// multiple typeof operators
var ResultIsString5 = typeof typeof ENUM;
var ResultIsString6 = typeof typeof typeof (ENUM[0] + ENUM1.B);
// miss assignment operators
typeof ENUM;
typeof ENUM1;
typeof ENUM1["B"];
typeof ENUM, ENUM1;
~~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
// use typeof in type query
enum z { };
z: typeof ENUM;
z: typeof ENUM1;
@@ -0,0 +1,63 @@
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts(45,1): error TS2695: Left side of comma operator is unused and has no side effects.
==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts (1 errors) ====
// typeof operator on number type
var NUMBER: number;
var NUMBER1: number[] = [1, 2];
function foo(): number { return 1; }
class A {
public a: number;
static foo() { return 1; }
}
module M {
export var n: number;
}
var objA = new A();
// number type var
var ResultIsString1 = typeof NUMBER;
var ResultIsString2 = typeof NUMBER1;
// number type literal
var ResultIsString3 = typeof 1;
var ResultIsString4 = typeof { x: 1, y: 2};
var ResultIsString5 = typeof { x: 1, y: (n: number) => { return n; } };
// number type expressions
var ResultIsString6 = typeof objA.a;
var ResultIsString7 = typeof M.n;
var ResultIsString8 = typeof NUMBER1[0];
var ResultIsString9 = typeof foo();
var ResultIsString10 = typeof A.foo();
var ResultIsString11 = typeof (NUMBER + NUMBER);
// multiple typeof operators
var ResultIsString12 = typeof typeof NUMBER;
var ResultIsString13 = typeof typeof typeof (NUMBER + NUMBER);
// miss assignment operators
typeof 1;
typeof NUMBER;
typeof NUMBER1;
typeof foo();
typeof objA.a;
typeof M.n;
typeof objA.a, M.n;
~~~~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
// use typeof in type query
var z: number;
var x: number[];
z: typeof NUMBER;
x: typeof NUMBER1;
r: typeof foo;
var y = { a: 1, b: 2 };
z: typeof y.a;
z: typeof objA.a;
z: typeof A.foo;
z: typeof M.n;
@@ -1,3 +1,4 @@
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(44,1): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(50,1): error TS7028: Unused label.
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(51,1): error TS7028: Unused label.
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(52,1): error TS7028: Unused label.
@@ -7,7 +8,7 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(57,1): error TS7028: Unused label.
==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts (7 errors) ====
==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts (8 errors) ====
// typeof operator on string type
var STRING: string;
var STRING1: string[] = ["", "abc"];
@@ -52,6 +53,8 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator
typeof STRING1;
typeof foo();
typeof objA.a, M.n;
~~~~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
// use typeof in type query
var z: string;
@@ -2,6 +2,7 @@ tests/cases/compiler/widenedTypes.ts(2,1): error TS2358: The left-hand side of a
tests/cases/compiler/widenedTypes.ts(5,1): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
tests/cases/compiler/widenedTypes.ts(6,7): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
tests/cases/compiler/widenedTypes.ts(8,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
tests/cases/compiler/widenedTypes.ts(10,14): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/compiler/widenedTypes.ts(11,1): error TS2322: Type '""' is not assignable to type 'number'.
tests/cases/compiler/widenedTypes.ts(18,1): error TS2322: Type '""' is not assignable to type 'number'.
tests/cases/compiler/widenedTypes.ts(23,5): error TS2322: Type 'number[]' is not assignable to type 'string[]'.
@@ -11,7 +12,7 @@ tests/cases/compiler/widenedTypes.ts(24,5): error TS2322: Type '{ x: number; y:
Type 'number' is not assignable to type 'string'.
==== tests/cases/compiler/widenedTypes.ts (8 errors) ====
==== tests/cases/compiler/widenedTypes.ts (9 errors) ====
null instanceof (() => { });
~~~~
@@ -30,6 +31,8 @@ tests/cases/compiler/widenedTypes.ts(24,5): error TS2322: Type '{ x: number; y:
!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
var t = [3, (3, null)];
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
t[3] = "";
~~~~
!!! error TS2322: Type '""' is not assignable to type 'number'.
+19 -1
View File
@@ -1,5 +1,11 @@
tests/cases/conformance/types/witness/witness.ts(8,21): error TS2372: Parameter 'pInit' cannot be referenced in its initializer.
tests/cases/conformance/types/witness/witness.ts(32,12): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/types/witness/witness.ts(33,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'co1' must be of type 'any', but here has type 'number'.
tests/cases/conformance/types/witness/witness.ts(34,12): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/types/witness/witness.ts(34,12): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/types/witness/witness.ts(36,12): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/types/witness/witness.ts(36,12): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/types/witness/witness.ts(36,12): error TS2695: Left side of comma operator is unused and has no side effects.
tests/cases/conformance/types/witness/witness.ts(37,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'co3' must be of type 'any', but here has type 'number'.
tests/cases/conformance/types/witness/witness.ts(41,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'as1' must be of type 'any', but here has type 'number'.
tests/cases/conformance/types/witness/witness.ts(43,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'as2' must be of type 'any', but here has type 'number'.
@@ -8,7 +14,7 @@ tests/cases/conformance/types/witness/witness.ts(61,5): error TS2403: Subsequent
tests/cases/conformance/types/witness/witness.ts(114,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'propAcc1' must be of type 'any', but here has type '{ m: any; }'.
==== tests/cases/conformance/types/witness/witness.ts (8 errors) ====
==== tests/cases/conformance/types/witness/witness.ts (14 errors) ====
@@ -43,12 +49,24 @@ tests/cases/conformance/types/witness/witness.ts(114,5): error TS2403: Subsequen
// Comma
var co1 = (co1, 3);
~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
var co1: number;
~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'co1' must be of type 'any', but here has type 'number'.
var co2 = (3, 4, co2);
~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
var co2: any;
var co3 = (co1, co2, co3, co1);
~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
~~~~~~~~~~~~~
!!! error TS2695: Left side of comma operator is unused and has no side effects.
var co3: number;
~~~
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'co3' must be of type 'any', but here has type 'number'.
@@ -0,0 +1,52 @@
var xx: any;
var yy: any;
function fn() {
let arr: any[] = [];
switch(arr.length) {
// Should error
case 0, 1:
return 'zero or one';
default:
return 'more than one';
}
}
// Should error
let x = Math.pow((3, 5), 2);
// Should error
let a = [(3 + 4), ((1 + 1, 8) * 4)];
// Error cases
xx = (1, 2);
xx = ('', xx);
xx = (/323/, 5);
xx = (`wat`, 'ok'),
xx = (true, false);
xx = (false, true);
xx = (null, xx);
xx = (undefined, 10);
xx = (() => {}, 'no');
xx = (function() { }, 100);
xx = ({}, {});
xx = (typeof xx, 'unused');
xx = ([1, 2, x++], xx);
xx = (xx!, xx);
xx = (xx ? 3 : 4, 10);
xx = (3 + 4, 10);
xx = (!xx, 10);
xx = (~xx, 10);
xx = (-xx, 10);
xx = (+xx, 10);
// OK cases
xx = (xx ? x++ : 4, 10);
xx = (--xx, 3);
xx = (xx = 3, 1);
xx = ((xx = 3), 5);
xx = (xx+= 4, xx);
xx = ((xx+= 4), xx);
xx = (Math.pow(3, 2), 4);
xx = (void xx, 10);
xx = (xx as any, 100);
@@ -1,5 +1,6 @@
// @lib: es5,es2015.promise
// @noEmitHelpers: true
// @allowUnreachableCode: true
// @target: ES5
declare var x, y, z, a, b, c;
@@ -1,3 +1,5 @@
// @allowUnreachableCode: true
declare function map<T, U>(array: T, func: (x: T) => U): U;
declare function identity<V>(y: V): V;
var s: string;
@@ -1,3 +1,5 @@
// @allowUnreachableCode: true
let x: string | number | boolean | RegExp;
let cond: boolean;
@@ -1,3 +1,5 @@
// @allowUnreachableCode: true
var BOOLEAN: boolean;
var NUMBER: number;
var STRING: string;

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