From ab0a788fc8ac3aa4663aa42cbda81c2e8155936f Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Fri, 9 Sep 2016 16:24:43 -0700 Subject: [PATCH 1/6] Disallow comma operator when LHS is pure --- src/compiler/checker.ts | 79 +++++++++++++++++++ src/compiler/diagnosticMessages.json | 4 + ...nmentToParenthesizedExpression1.errors.txt | 7 +- .../reference/commaOperator1.errors.txt | 33 ++++++++ .../compiler/commaOperatorLeftSideUnused.ts | 45 +++++++++++ 5 files changed, 166 insertions(+), 2 deletions(-) create mode 100644 tests/baselines/reference/commaOperator1.errors.txt create mode 100644 tests/cases/compiler/commaOperatorLeftSideUnused.ts diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index f5eb12a419e..efa9dd478a1 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13209,6 +13209,82 @@ namespace ts { return sourceType; } + function isSideEffectFree(node: Node): boolean { + switch (node.kind) { + case SyntaxKind.Identifier: + case SyntaxKind.StringLiteral: + case SyntaxKind.RegularExpressionLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: + case SyntaxKind.NumericLiteral: + case SyntaxKind.TrueKeyword: + case SyntaxKind.FalseKeyword: + case SyntaxKind.NullKeyword: + case SyntaxKind.UndefinedKeyword: + case SyntaxKind.FunctionExpression: + case SyntaxKind.ArrowFunction: + return true; + + 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: + switch ((node as PrefixUnaryExpression).operator) { + case SyntaxKind.ExclamationToken: + case SyntaxKind.PlusToken: + case SyntaxKind.MinusToken: + case SyntaxKind.TildeToken: + return isSideEffectFree((node as PrefixUnaryExpression).operand); + } + return false; + + case SyntaxKind.ParenthesizedExpression: + case SyntaxKind.TypeAssertionExpression: + case SyntaxKind.TypeOfExpression: + case SyntaxKind.AsExpression: + case SyntaxKind.NonNullExpression: + // All the nodes which just have a .expression we should check + return isSideEffectFree((node as ParenthesizedExpression).expression); + + case SyntaxKind.ConditionalExpression: + return isSideEffectFree((node as ConditionalExpression).condition) && + isSideEffectFree((node as ConditionalExpression).whenTrue) && + isSideEffectFree((node as ConditionalExpression).whenFalse); + + case SyntaxKind.ObjectLiteralExpression: + // Note: negated forEach condition since we want to bail early to 'true', + // in other words the callback is computing "Could have side effects?" + return !forEach((node as ObjectLiteralExpression).properties, prop => { + if (isComputedPropertyName(prop.name) && !isSideEffectFree((prop.name as ComputedPropertyName).expression)) { + return true; + } + + switch (prop.kind) { + case SyntaxKind.ShorthandPropertyAssignment: + case SyntaxKind.MethodDeclaration: + return false; + case SyntaxKind.PropertyAssignment: + return !isSideEffectFree((prop as PropertyAssignment).initializer); + default: + Debug.fail('Unhandled object literal property kind ' + prop.kind); + } + }); + + case SyntaxKind.ArrayLiteralExpression: + // See previous comment about negated callback values + return !forEach((node as ArrayLiteralExpression).elements, elem => !isSideEffectFree(elem)); + + case SyntaxKind.VoidExpression: + // Explicit opt-out case (listed here to avoid accidental duplication above): 'void x' + default: + return false; + } + } + function isTypeEqualityComparableTo(source: Type, target: Type) { return (target.flags & TypeFlags.Nullable) !== 0 || isTypeComparableTo(source, target); } @@ -13370,6 +13446,9 @@ namespace ts { checkAssignmentOperator(rightType); return getRegularTypeOfObjectLiteral(rightType); case SyntaxKind.CommaToken: + if (isSideEffectFree(left) && !compilerOptions.allowUnreachableCode) { + error(left, Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects); + } return rightType; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index cddb132f56c..e6e6efd03be 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1955,6 +1955,10 @@ "category": "Error", "code": 2692 }, + "Left side of comma operator is unused and has no side effects.": { + "category": "Error", + "code": 2693 + }, "Import declaration '{0}' is using private name '{1}'.": { "category": "Error", "code": 4000 diff --git a/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt b/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt index 0b1b1e04de8..534f74ed799 100644 --- a/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt +++ b/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt @@ -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 TS2693: Left operand of comma operator may not be a side-effect free expression. -==== 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. \ No newline at end of file +!!! error TS2364: Invalid left-hand side of assignment expression. + ~ +!!! error TS2693: Left operand of comma operator may not be a side-effect free expression. \ No newline at end of file diff --git a/tests/baselines/reference/commaOperator1.errors.txt b/tests/baselines/reference/commaOperator1.errors.txt new file mode 100644 index 00000000000..c0668ceb2f5 --- /dev/null +++ b/tests/baselines/reference/commaOperator1.errors.txt @@ -0,0 +1,33 @@ +tests/cases/compiler/commaOperator1.ts(1,11): error TS2693: Left operand of comma operator may not be a side-effect free expression. +tests/cases/compiler/commaOperator1.ts(1,11): error TS2693: Left operand of comma operator may not be a side-effect free expression. +tests/cases/compiler/commaOperator1.ts(1,11): error TS2693: Left operand of comma operator may not be a side-effect free expression. +tests/cases/compiler/commaOperator1.ts(1,12): error TS2693: Left operand of comma operator may not be a side-effect free expression. +tests/cases/compiler/commaOperator1.ts(1,12): error TS2693: Left operand of comma operator may not be a side-effect free expression. +tests/cases/compiler/commaOperator1.ts(1,29): error TS2693: Left operand of comma operator may not be a side-effect free expression. +tests/cases/compiler/commaOperator1.ts(4,12): error TS2693: Left operand of comma operator may not be a side-effect free expression. +tests/cases/compiler/commaOperator1.ts(4,12): error TS2693: Left operand of comma operator may not be a side-effect free expression. + + +==== tests/cases/compiler/commaOperator1.ts (8 errors) ==== + var v1 = ((1, 2, 3), 4, 5, (6, 7)); + ~~~~~~~~~ +!!! error TS2693: Left operand of comma operator may not be a side-effect free expression. + ~~~~~~~~~~~~ +!!! error TS2693: Left operand of comma operator may not be a side-effect free expression. + ~~~~~~~~~~~~~~~ +!!! error TS2693: Left operand of comma operator may not be a side-effect free expression. + ~ +!!! error TS2693: Left operand of comma operator may not be a side-effect free expression. + ~~~~ +!!! error TS2693: Left operand of comma operator may not be a side-effect free expression. + ~ +!!! error TS2693: Left operand of comma operator may not be a side-effect free expression. + function f1() { + var a = 1; + return a, v1, a; + ~ +!!! error TS2693: Left operand of comma operator may not be a side-effect free expression. + ~~~~~ +!!! error TS2693: Left operand of comma operator may not be a side-effect free expression. + } + \ No newline at end of file diff --git a/tests/cases/compiler/commaOperatorLeftSideUnused.ts b/tests/cases/compiler/commaOperatorLeftSideUnused.ts new file mode 100644 index 00000000000..b52d122b5c0 --- /dev/null +++ b/tests/cases/compiler/commaOperatorLeftSideUnused.ts @@ -0,0 +1,45 @@ +var xx: 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)]; + +// Should be OK +xx = x++, 2; +xx = x = 3, 2; + +// Should error +xx = x = (3, 2); + +// Error cases (object literals) +xx = ({ x: 3 }, 14); +xx = ({ y() { } }, 14); + +// OK cases (object literals) +xx = ({ m: Math.pow(2, 3) }), 14; +xx = ({ ['foo'.substr(3)]: 5 }), 14; + +// Error cases (array literals) +xx = ([1, 2], 4); +xx = ([], 4); +xx = ([[]], 4); +xx = ([{}], ''); +xx = ([false, true, (xx, xx)], 4); + +// OK cases (array literals) +xx = ([1, ''.substr(0)], ''); +xx = ([new Date()], ''); +xx = ([console.log], ''); From 5b3c272dbbea9bd0c431ab8bb34237a55367884e Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Mon, 12 Sep 2016 14:45:42 -0700 Subject: [PATCH 2/6] Disallow left comma operator operands which don't have side effects --- src/compiler/checker.ts | 63 ++++----- ...nmentToParenthesizedExpression1.errors.txt | 4 +- ...wiseNotOperatorWithAnyOtherType.errors.txt | 7 +- .../bitwiseNotOperatorWithAnyOtherType.js | 1 + .../bitwiseNotOperatorWithBooleanType.js | 1 + .../bitwiseNotOperatorWithBooleanType.symbols | 79 +++++------ .../bitwiseNotOperatorWithBooleanType.types | 1 + .../bitwiseNotOperatorWithEnumType.js | 1 + .../bitwiseNotOperatorWithEnumType.symbols | 35 ++--- .../bitwiseNotOperatorWithEnumType.types | 1 + .../bitwiseNotOperatorWithNumberType.js | 1 + .../bitwiseNotOperatorWithNumberType.symbols | 125 +++++++++--------- .../bitwiseNotOperatorWithNumberType.types | 1 + .../bitwiseNotOperatorWithStringType.js | 1 + .../bitwiseNotOperatorWithStringType.symbols | 117 ++++++++-------- .../bitwiseNotOperatorWithStringType.types | 1 + .../reference/commaOperator1.errors.txt | 32 ++--- ...maOperatorInvalidAssignmentType.errors.txt | 13 +- .../commaOperatorInvalidAssignmentType.js | 1 + .../commaOperatorLeftSideUnused.errors.txt | 125 ++++++++++++++++++ .../reference/commaOperatorLeftSideUnused.js | 103 +++++++++++++++ ...maOperatorOtherInvalidOperation.errors.txt | 5 +- .../commaOperatorOtherInvalidOperation.js | 1 + .../commaOperatorOtherValidOperation.js | 1 + .../commaOperatorOtherValidOperation.symbols | 51 +++---- .../commaOperatorOtherValidOperation.types | 1 + .../commaOperatorWithSecondOperandAnyType.js | 1 + ...maOperatorWithSecondOperandAnyType.symbols | 99 +++++++------- ...ommaOperatorWithSecondOperandAnyType.types | 1 + ...mmaOperatorWithSecondOperandBooleanType.js | 1 + ...eratorWithSecondOperandBooleanType.symbols | 101 +++++++------- ...OperatorWithSecondOperandBooleanType.types | 1 + ...ommaOperatorWithSecondOperandNumberType.js | 1 + ...peratorWithSecondOperandNumberType.symbols | 101 +++++++------- ...aOperatorWithSecondOperandNumberType.types | 1 + ...ommaOperatorWithSecondOperandObjectType.js | 1 + ...peratorWithSecondOperandObjectType.symbols | 105 +++++++-------- ...aOperatorWithSecondOperandObjectType.types | 1 + ...ommaOperatorWithSecondOperandStringType.js | 1 + ...peratorWithSecondOperandStringType.symbols | 101 +++++++------- ...aOperatorWithSecondOperandStringType.types | 1 + .../commaOperatorWithoutOperand.errors.txt | 35 ++++- .../commaOperatorsMultipleOperators.js | 1 + .../commaOperatorsMultipleOperators.symbols | 93 ++++++------- .../commaOperatorsMultipleOperators.types | 1 + .../reference/controlFlowIfStatement.js | 1 + .../reference/controlFlowIfStatement.symbols | 73 +++++----- .../reference/controlFlowIfStatement.types | 1 + ...tructuringParameterDeclaration6.errors.txt | 8 +- ...rowfunctionsOptionalArgsErrors2.errors.txt | 14 +- ...ypingWithFunctionTypeSyntacticScenarios.js | 1 + ...WithFunctionTypeSyntacticScenarios.symbols | 89 +++++++------ ...ngWithFunctionTypeSyntacticScenarios.types | 1 + .../compiler/commaOperatorLeftSideUnused.ts | 57 ++++---- .../es5-asyncFunctionBinaryExpressions.ts | 1 + ...ypingWithFunctionTypeSyntacticScenarios.ts | 2 + .../controlFlow/controlFlowIfStatement.ts | 2 + .../commaOperatorInvalidAssignmentType.ts | 2 + .../commaOperatorOtherInvalidOperation.ts | 2 + .../commaOperatorOtherValidOperation.ts | 2 + .../commaOperatorWithSecondOperandAnyType.ts | 2 + ...mmaOperatorWithSecondOperandBooleanType.ts | 2 + ...ommaOperatorWithSecondOperandNumberType.ts | 2 + ...ommaOperatorWithSecondOperandObjectType.ts | 2 + ...ommaOperatorWithSecondOperandStringType.ts | 2 + .../commaOperatorsMultipleOperators.ts | 2 + .../bitwiseNotOperatorWithAnyOtherType.ts | 2 + .../bitwiseNotOperatorWithBooleanType.ts | 2 + .../bitwiseNotOperatorWithEnumType.ts | 2 + .../bitwiseNotOperatorWithNumberType.ts | 2 + .../bitwiseNotOperatorWithStringType.ts | 2 + .../contextuallyTypeCommaOperator01.ts | 1 + .../contextuallyTypeCommaOperator02.ts | 1 + .../contextuallyTypeCommaOperator03.ts | 1 + 74 files changed, 1026 insertions(+), 674 deletions(-) create mode 100644 tests/baselines/reference/commaOperatorLeftSideUnused.errors.txt create mode 100644 tests/baselines/reference/commaOperatorLeftSideUnused.js diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index efa9dd478a1..86b3776dad7 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13209,7 +13209,16 @@ 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: @@ -13222,8 +13231,16 @@ namespace ts { case SyntaxKind.UndefinedKeyword: case SyntaxKind.FunctionExpression: case SyntaxKind.ArrowFunction: + case SyntaxKind.ArrayLiteralExpression: + case SyntaxKind.ObjectLiteralExpression: + case SyntaxKind.TypeOfExpression: + case SyntaxKind.NonNullExpression: 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; @@ -13233,53 +13250,21 @@ namespace ts { 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 isSideEffectFree((node as PrefixUnaryExpression).operand); + return true; } return false; - - case SyntaxKind.ParenthesizedExpression: - case SyntaxKind.TypeAssertionExpression: - case SyntaxKind.TypeOfExpression: - case SyntaxKind.AsExpression: - case SyntaxKind.NonNullExpression: - // All the nodes which just have a .expression we should check - return isSideEffectFree((node as ParenthesizedExpression).expression); - - case SyntaxKind.ConditionalExpression: - return isSideEffectFree((node as ConditionalExpression).condition) && - isSideEffectFree((node as ConditionalExpression).whenTrue) && - isSideEffectFree((node as ConditionalExpression).whenFalse); - case SyntaxKind.ObjectLiteralExpression: - // Note: negated forEach condition since we want to bail early to 'true', - // in other words the callback is computing "Could have side effects?" - return !forEach((node as ObjectLiteralExpression).properties, prop => { - if (isComputedPropertyName(prop.name) && !isSideEffectFree((prop.name as ComputedPropertyName).expression)) { - return true; - } - - switch (prop.kind) { - case SyntaxKind.ShorthandPropertyAssignment: - case SyntaxKind.MethodDeclaration: - return false; - case SyntaxKind.PropertyAssignment: - return !isSideEffectFree((prop as PropertyAssignment).initializer); - default: - Debug.fail('Unhandled object literal property kind ' + prop.kind); - } - }); - - case SyntaxKind.ArrayLiteralExpression: - // See previous comment about negated callback values - return !forEach((node as ArrayLiteralExpression).elements, elem => !isSideEffectFree(elem)); - - case SyntaxKind.VoidExpression: - // Explicit opt-out case (listed here to avoid accidental duplication above): 'void x' + // 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; } diff --git a/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt b/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt index 534f74ed799..3dbadea09e2 100644 --- a/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt +++ b/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/assignmentToParenthesizedExpression1.ts(2,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/assignmentToParenthesizedExpression1.ts(2,2): error TS2693: Left operand of comma operator may not be a side-effect free expression. +tests/cases/compiler/assignmentToParenthesizedExpression1.ts(2,2): error TS2693: Left side of comma operator is unused and has no side effects. ==== tests/cases/compiler/assignmentToParenthesizedExpression1.ts (2 errors) ==== @@ -8,4 +8,4 @@ tests/cases/compiler/assignmentToParenthesizedExpression1.ts(2,2): error TS2693: ~~~~~~ !!! error TS2364: Invalid left-hand side of assignment expression. ~ -!!! error TS2693: Left operand of comma operator may not be a side-effect free expression. \ No newline at end of file +!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt index fe91cc8a339..66d4cbb628e 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.errors.txt @@ -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; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js index 0236bd736ee..860dbc68a53 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithAnyOtherType.js @@ -1,4 +1,5 @@ //// [bitwiseNotOperatorWithAnyOtherType.ts] + // ~ operator on any type var ANY: any; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js index b35a5e4ba12..cd0e967b66f 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.js @@ -1,4 +1,5 @@ //// [bitwiseNotOperatorWithBooleanType.ts] + // ~ operator on boolean type var BOOLEAN: boolean; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.symbols b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.symbols index d52e73ba600..ad30b16dd08 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.symbols +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.symbols @@ -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)) diff --git a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types index 234c01e2241..74cad8b75b6 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithBooleanType.types @@ -1,4 +1,5 @@ === tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithBooleanType.ts === + // ~ operator on boolean type var BOOLEAN: boolean; >BOOLEAN : boolean diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js index 0bcf2fa3956..a270fc98c51 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.js @@ -1,4 +1,5 @@ //// [bitwiseNotOperatorWithEnumType.ts] + // ~ operator on enum type enum ENUM1 { A, B, "" }; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.symbols b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.symbols index 24783a153ae..6bd0aa8ad55 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.symbols +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.symbols @@ -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)) diff --git a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types index bb8be9b3f54..e6475b6cdea 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithEnumType.types @@ -1,4 +1,5 @@ === tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithEnumType.ts === + // ~ operator on enum type enum ENUM1 { A, B, "" }; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js index aab04be6dfc..b6660f677c7 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.js @@ -1,4 +1,5 @@ //// [bitwiseNotOperatorWithNumberType.ts] + // ~ operator on number type var NUMBER: number; var NUMBER1: number[] = [1, 2]; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.symbols b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.symbols index f7dd03d78c3..8ce159b9171 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.symbols +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.symbols @@ -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)) diff --git a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types index 228bd43e593..a989a9bbe27 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithNumberType.types @@ -1,4 +1,5 @@ === tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithNumberType.ts === + // ~ operator on number type var NUMBER: number; >NUMBER : number diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.js b/tests/baselines/reference/bitwiseNotOperatorWithStringType.js index 366af5ecea8..b1c3b41f286 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithStringType.js +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.js @@ -1,4 +1,5 @@ //// [bitwiseNotOperatorWithStringType.ts] + // ~ operator on string type var STRING: string; var STRING1: string[] = ["", "abc"]; diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.symbols b/tests/baselines/reference/bitwiseNotOperatorWithStringType.symbols index f535acc199b..06f848c7450 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithStringType.symbols +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.symbols @@ -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)) diff --git a/tests/baselines/reference/bitwiseNotOperatorWithStringType.types b/tests/baselines/reference/bitwiseNotOperatorWithStringType.types index 4f1ca481a1f..4d75afb86a4 100644 --- a/tests/baselines/reference/bitwiseNotOperatorWithStringType.types +++ b/tests/baselines/reference/bitwiseNotOperatorWithStringType.types @@ -1,4 +1,5 @@ === tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithStringType.ts === + // ~ operator on string type var STRING: string; >STRING : string diff --git a/tests/baselines/reference/commaOperator1.errors.txt b/tests/baselines/reference/commaOperator1.errors.txt index c0668ceb2f5..0a2c7ad1c80 100644 --- a/tests/baselines/reference/commaOperator1.errors.txt +++ b/tests/baselines/reference/commaOperator1.errors.txt @@ -1,33 +1,33 @@ -tests/cases/compiler/commaOperator1.ts(1,11): error TS2693: Left operand of comma operator may not be a side-effect free expression. -tests/cases/compiler/commaOperator1.ts(1,11): error TS2693: Left operand of comma operator may not be a side-effect free expression. -tests/cases/compiler/commaOperator1.ts(1,11): error TS2693: Left operand of comma operator may not be a side-effect free expression. -tests/cases/compiler/commaOperator1.ts(1,12): error TS2693: Left operand of comma operator may not be a side-effect free expression. -tests/cases/compiler/commaOperator1.ts(1,12): error TS2693: Left operand of comma operator may not be a side-effect free expression. -tests/cases/compiler/commaOperator1.ts(1,29): error TS2693: Left operand of comma operator may not be a side-effect free expression. -tests/cases/compiler/commaOperator1.ts(4,12): error TS2693: Left operand of comma operator may not be a side-effect free expression. -tests/cases/compiler/commaOperator1.ts(4,12): error TS2693: Left operand of comma operator may not be a side-effect free expression. +tests/cases/compiler/commaOperator1.ts(1,11): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperator1.ts(1,11): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperator1.ts(1,11): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperator1.ts(1,12): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperator1.ts(1,12): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperator1.ts(1,29): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperator1.ts(4,12): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperator1.ts(4,12): error TS2693: 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 TS2693: Left operand of comma operator may not be a side-effect free expression. +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~~~~~~~~~~~~ -!!! error TS2693: Left operand of comma operator may not be a side-effect free expression. +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~~~~~~~~~~~~~~~ -!!! error TS2693: Left operand of comma operator may not be a side-effect free expression. +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ -!!! error TS2693: Left operand of comma operator may not be a side-effect free expression. +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~~~~ -!!! error TS2693: Left operand of comma operator may not be a side-effect free expression. +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ -!!! error TS2693: Left operand of comma operator may not be a side-effect free expression. +!!! error TS2693: Left side of comma operator is unused and has no side effects. function f1() { var a = 1; return a, v1, a; ~ -!!! error TS2693: Left operand of comma operator may not be a side-effect free expression. +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~~~~~ -!!! error TS2693: Left operand of comma operator may not be a side-effect free expression. +!!! error TS2693: Left side of comma operator is unused and has no side effects. } \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt b/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt index ecf7e5ed1dc..a22fbb1e1d0 100644 --- a/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt +++ b/tests/baselines/reference/commaOperatorInvalidAssignmentType.errors.txt @@ -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; diff --git a/tests/baselines/reference/commaOperatorInvalidAssignmentType.js b/tests/baselines/reference/commaOperatorInvalidAssignmentType.js index 0d6b9389cfc..9a16d4bbc28 100644 --- a/tests/baselines/reference/commaOperatorInvalidAssignmentType.js +++ b/tests/baselines/reference/commaOperatorInvalidAssignmentType.js @@ -1,4 +1,5 @@ //// [commaOperatorInvalidAssignmentType.ts] + var BOOLEAN: boolean; var NUMBER: number; var STRING: string; diff --git a/tests/baselines/reference/commaOperatorLeftSideUnused.errors.txt b/tests/baselines/reference/commaOperatorLeftSideUnused.errors.txt new file mode 100644 index 00000000000..8f8be40f0ac --- /dev/null +++ b/tests/baselines/reference/commaOperatorLeftSideUnused.errors.txt @@ -0,0 +1,125 @@ +tests/cases/compiler/commaOperatorLeftSideUnused.ts(8,10): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(16,19): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(19,21): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(22,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(23,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(24,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(25,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(26,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(27,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(28,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(29,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(30,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(31,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(32,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(33,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(34,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(35,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(36,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(37,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(38,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(39,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(40,7): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/commaOperatorLeftSideUnused.ts(41,7): error TS2693: 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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. + + // Should error + let a = [(3 + 4), ((1 + 1, 8) * 4)]; + ~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + + // Error cases + xx = (1, 2); + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = ('', xx); + ~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = (/323/, 5); + ~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = (`wat`, 'ok'), + ~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = (true, false); + ~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = (false, true); + ~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = (null, xx); + ~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = (undefined, 10); + ~~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = (() => {}, 'no'); + ~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = (function() { }, 100); + ~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = ({}, {}); + ~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = (typeof xx, 'unused'); + ~~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = ([1, 2, x++], xx); + ~~~~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = (xx!, xx); + ~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = (xx ? 3 : 4, 10); + ~~~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = (3 + 4, 10); + ~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = (!xx, 10); + ~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = (~xx, 10); + ~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = (-xx, 10); + ~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + xx = (+xx, 10); + ~~~ +!!! error TS2693: 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); + \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorLeftSideUnused.js b/tests/baselines/reference/commaOperatorLeftSideUnused.js new file mode 100644 index 00000000000..3ca4abfa8cd --- /dev/null +++ b/tests/baselines/reference/commaOperatorLeftSideUnused.js @@ -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); diff --git a/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt b/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt index 32e8464a195..a38fcd0741e 100644 --- a/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt +++ b/tests/baselines/reference/commaOperatorOtherInvalidOperation.errors.txt @@ -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) { diff --git a/tests/baselines/reference/commaOperatorOtherInvalidOperation.js b/tests/baselines/reference/commaOperatorOtherInvalidOperation.js index d14dec67709..996b08e2ca0 100644 --- a/tests/baselines/reference/commaOperatorOtherInvalidOperation.js +++ b/tests/baselines/reference/commaOperatorOtherInvalidOperation.js @@ -1,4 +1,5 @@ //// [commaOperatorOtherInvalidOperation.ts] + //Expect to have compiler errors //Comma operator in fuction arguments and return function foo(x: number, y: string) { diff --git a/tests/baselines/reference/commaOperatorOtherValidOperation.js b/tests/baselines/reference/commaOperatorOtherValidOperation.js index 383b7c5058e..3a08735a2ed 100644 --- a/tests/baselines/reference/commaOperatorOtherValidOperation.js +++ b/tests/baselines/reference/commaOperatorOtherValidOperation.js @@ -1,4 +1,5 @@ //// [commaOperatorOtherValidOperation.ts] + //Comma operator in for loop for (var i = 0, j = 10; i < j; i++, j--) { diff --git a/tests/baselines/reference/commaOperatorOtherValidOperation.symbols b/tests/baselines/reference/commaOperatorOtherValidOperation.symbols index da65d20fc30..b0ff23dc118 100644 --- a/tests/baselines/reference/commaOperatorOtherValidOperation.symbols +++ b/tests/baselines/reference/commaOperatorOtherValidOperation.symbols @@ -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() ->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)) } diff --git a/tests/baselines/reference/commaOperatorOtherValidOperation.types b/tests/baselines/reference/commaOperatorOtherValidOperation.types index bc7bdd81157..46993fb5ce5 100644 --- a/tests/baselines/reference/commaOperatorOtherValidOperation.types +++ b/tests/baselines/reference/commaOperatorOtherValidOperation.types @@ -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 diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js index 522bbbe4e19..d7b857f9f8f 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.js @@ -1,4 +1,5 @@ //// [commaOperatorWithSecondOperandAnyType.ts] + var ANY: any; var BOOLEAN: boolean; var NUMBER: number; diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.symbols index ba9618a5ecf..ecd5a3932ba 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.symbols +++ b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.symbols @@ -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)) diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types index a8217c2d248..99eedf8a15e 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandAnyType.types @@ -1,4 +1,5 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandAnyType.ts === + var ANY: any; >ANY : any diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js index dfaba1a93ca..92996fe679d 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.js @@ -1,4 +1,5 @@ //// [commaOperatorWithSecondOperandBooleanType.ts] + var ANY: any; var BOOLEAN: boolean; var NUMBER: number; diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.symbols index 9be885bf41c..2ea892ad16e 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.symbols +++ b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.symbols @@ -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)) diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types index dba5285d880..8aa5c96041c 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandBooleanType.types @@ -1,4 +1,5 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandBooleanType.ts === + var ANY: any; >ANY : any diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.js b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.js index b5b8887e749..45d38c9c9c5 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.js @@ -1,4 +1,5 @@ //// [commaOperatorWithSecondOperandNumberType.ts] + var ANY: any; var BOOLEAN: boolean; var NUMBER: number; diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.symbols index bf5ff9437a3..3e6fdfd9ef8 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.symbols +++ b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.symbols @@ -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)) diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types index 13aae51e0cb..7932bcb40a7 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandNumberType.types @@ -1,4 +1,5 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandNumberType.ts === + var ANY: any; >ANY : any diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js index ef814863934..dd269d88217 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.js @@ -1,4 +1,5 @@ //// [commaOperatorWithSecondOperandObjectType.ts] + var ANY: any; var BOOLEAN: boolean; var NUMBER: number; diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.symbols index 6df26708078..cfaab330b46 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.symbols +++ b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.symbols @@ -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)) diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types index 9c948da9699..750ea416285 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandObjectType.types @@ -1,4 +1,5 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandObjectType.ts === + var ANY: any; >ANY : any diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js index 412e9e83121..f3f19563817 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js +++ b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.js @@ -1,4 +1,5 @@ //// [commaOperatorWithSecondOperandStringType.ts] + var ANY: any; var BOOLEAN: boolean; var NUMBER: number; diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.symbols b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.symbols index 2d9fc665a81..d4f5873f493 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.symbols +++ b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.symbols @@ -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)) diff --git a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types index a28202876d2..25bf29ac6ce 100644 --- a/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types +++ b/tests/baselines/reference/commaOperatorWithSecondOperandStringType.types @@ -1,4 +1,5 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandStringType.ts === + var ANY: any; >ANY : any diff --git a/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt b/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt index 7120a827042..83da6522917 100644 --- a/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt +++ b/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt @@ -1,18 +1,29 @@ +tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(9,2): error TS2693: 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 TS2693: 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 TS2693: 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 TS2693: 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 TS2693: 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 TS2693: 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 TS2693: 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 TS2693: 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 TS2693: 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 TS2693: 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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. (BOOLEAN, ); + ~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. (NUMBER, ); + ~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. (STRING, ); + ~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. (OBJECT, ); + ~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. // Missing the first operand (, ANY); + +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. (, BOOLEAN); + +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. (, NUMBER); + +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. (, STRING); + +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. (, OBJECT); + +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. // Missing all operands ( , ); + +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS1109: Expression expected. ~ diff --git a/tests/baselines/reference/commaOperatorsMultipleOperators.js b/tests/baselines/reference/commaOperatorsMultipleOperators.js index 15d93c1f18c..5157eb2c8ff 100644 --- a/tests/baselines/reference/commaOperatorsMultipleOperators.js +++ b/tests/baselines/reference/commaOperatorsMultipleOperators.js @@ -1,4 +1,5 @@ //// [commaOperatorsMultipleOperators.ts] + var ANY: any; var BOOLEAN: boolean; var NUMBER: number; diff --git a/tests/baselines/reference/commaOperatorsMultipleOperators.symbols b/tests/baselines/reference/commaOperatorsMultipleOperators.symbols index 3a580bc49e9..bc1953709c2 100644 --- a/tests/baselines/reference/commaOperatorsMultipleOperators.symbols +++ b/tests/baselines/reference/commaOperatorsMultipleOperators.symbols @@ -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, --, --)) diff --git a/tests/baselines/reference/commaOperatorsMultipleOperators.types b/tests/baselines/reference/commaOperatorsMultipleOperators.types index 9a2c7c7e5c5..f6d0425c306 100644 --- a/tests/baselines/reference/commaOperatorsMultipleOperators.types +++ b/tests/baselines/reference/commaOperatorsMultipleOperators.types @@ -1,4 +1,5 @@ === tests/cases/conformance/expressions/commaOperator/commaOperatorsMultipleOperators.ts === + var ANY: any; >ANY : any diff --git a/tests/baselines/reference/controlFlowIfStatement.js b/tests/baselines/reference/controlFlowIfStatement.js index e40b831552f..5b09b13e5fd 100644 --- a/tests/baselines/reference/controlFlowIfStatement.js +++ b/tests/baselines/reference/controlFlowIfStatement.js @@ -1,4 +1,5 @@ //// [controlFlowIfStatement.ts] + let x: string | number | boolean | RegExp; let cond: boolean; diff --git a/tests/baselines/reference/controlFlowIfStatement.symbols b/tests/baselines/reference/controlFlowIfStatement.symbols index e4d2bb9f184..29d235de780 100644 --- a/tests/baselines/reference/controlFlowIfStatement.symbols +++ b/tests/baselines/reference/controlFlowIfStatement.symbols @@ -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(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(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)) } } diff --git a/tests/baselines/reference/controlFlowIfStatement.types b/tests/baselines/reference/controlFlowIfStatement.types index 79985378bf5..4918302813b 100644 --- a/tests/baselines/reference/controlFlowIfStatement.types +++ b/tests/baselines/reference/controlFlowIfStatement.types @@ -1,4 +1,5 @@ === tests/cases/conformance/controlFlow/controlFlowIfStatement.ts === + let x: string | number | boolean | RegExp; >x : string | number | boolean | RegExp >RegExp : RegExp diff --git a/tests/baselines/reference/destructuringParameterDeclaration6.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration6.errors.txt index 15d25ebc60e..c7594d3aa1c 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration6.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration6.errors.txt @@ -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 TS2693: 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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS1005: '(' expected. ~~~ !!! error TS1109: Expression expected. + +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS1005: '(' expected. ~~~~~~ diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt index 6ac472e0e02..5f2b5db53bc 100644 --- a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt @@ -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 TS2693: 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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,12): error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'b'. + ~ +!!! error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. + ~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'a'. ~ diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.js b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.js index 2f5eea63a8a..018726f5549 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.js +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.js @@ -1,4 +1,5 @@ //// [inferentialTypingWithFunctionTypeSyntacticScenarios.ts] + declare function map(array: T, func: (x: T) => U): U; declare function identity(y: V): V; var s: string; diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.symbols b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.symbols index a9571bc8a38..1ad418cb599 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.symbols +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.symbols @@ -1,94 +1,95 @@ === tests/cases/compiler/inferentialTypingWithFunctionTypeSyntacticScenarios.ts === + declare function map(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(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("", 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)) diff --git a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types index 5a4decef4dc..5537af77634 100644 --- a/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types +++ b/tests/baselines/reference/inferentialTypingWithFunctionTypeSyntacticScenarios.types @@ -1,4 +1,5 @@ === tests/cases/compiler/inferentialTypingWithFunctionTypeSyntacticScenarios.ts === + declare function map(array: T, func: (x: T) => U): U; >map : (array: T, func: (x: T) => U) => U >T : T diff --git a/tests/cases/compiler/commaOperatorLeftSideUnused.ts b/tests/cases/compiler/commaOperatorLeftSideUnused.ts index b52d122b5c0..b4ac6ac1a17 100644 --- a/tests/cases/compiler/commaOperatorLeftSideUnused.ts +++ b/tests/cases/compiler/commaOperatorLeftSideUnused.ts @@ -1,4 +1,5 @@ var xx: any; +var yy: any; function fn() { let arr: any[] = []; @@ -17,29 +18,35 @@ let x = Math.pow((3, 5), 2); // Should error let a = [(3 + 4), ((1 + 1, 8) * 4)]; -// Should be OK -xx = x++, 2; -xx = x = 3, 2; +// 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); -// Should error -xx = x = (3, 2); - -// Error cases (object literals) -xx = ({ x: 3 }, 14); -xx = ({ y() { } }, 14); - -// OK cases (object literals) -xx = ({ m: Math.pow(2, 3) }), 14; -xx = ({ ['foo'.substr(3)]: 5 }), 14; - -// Error cases (array literals) -xx = ([1, 2], 4); -xx = ([], 4); -xx = ([[]], 4); -xx = ([{}], ''); -xx = ([false, true, (xx, xx)], 4); - -// OK cases (array literals) -xx = ([1, ''.substr(0)], ''); -xx = ([new Date()], ''); -xx = ([console.log], ''); +// 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); diff --git a/tests/cases/compiler/es5-asyncFunctionBinaryExpressions.ts b/tests/cases/compiler/es5-asyncFunctionBinaryExpressions.ts index cb633640466..6d8afb166c0 100644 --- a/tests/cases/compiler/es5-asyncFunctionBinaryExpressions.ts +++ b/tests/cases/compiler/es5-asyncFunctionBinaryExpressions.ts @@ -1,5 +1,6 @@ // @lib: es5,es2015.promise // @noEmitHelpers: true +// @allowUnreachableCode: true // @target: ES5 declare var x, y, z, a, b, c; diff --git a/tests/cases/compiler/inferentialTypingWithFunctionTypeSyntacticScenarios.ts b/tests/cases/compiler/inferentialTypingWithFunctionTypeSyntacticScenarios.ts index 6f9b8fbb775..8e7f3a963a8 100644 --- a/tests/cases/compiler/inferentialTypingWithFunctionTypeSyntacticScenarios.ts +++ b/tests/cases/compiler/inferentialTypingWithFunctionTypeSyntacticScenarios.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + declare function map(array: T, func: (x: T) => U): U; declare function identity(y: V): V; var s: string; diff --git a/tests/cases/conformance/controlFlow/controlFlowIfStatement.ts b/tests/cases/conformance/controlFlow/controlFlowIfStatement.ts index dc1cf97fe59..bd2e606d13f 100644 --- a/tests/cases/conformance/controlFlow/controlFlowIfStatement.ts +++ b/tests/cases/conformance/controlFlow/controlFlowIfStatement.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + let x: string | number | boolean | RegExp; let cond: boolean; diff --git a/tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts b/tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts index a4599a55246..b0eb6ec4d8b 100644 --- a/tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts +++ b/tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + var BOOLEAN: boolean; var NUMBER: number; var STRING: string; diff --git a/tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts b/tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts index a6b7dd63e80..3d9fffb4df1 100644 --- a/tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts +++ b/tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + //Expect to have compiler errors //Comma operator in fuction arguments and return function foo(x: number, y: string) { diff --git a/tests/cases/conformance/expressions/commaOperator/commaOperatorOtherValidOperation.ts b/tests/cases/conformance/expressions/commaOperator/commaOperatorOtherValidOperation.ts index 03f4762e413..f9b984d1ee3 100644 --- a/tests/cases/conformance/expressions/commaOperator/commaOperatorOtherValidOperation.ts +++ b/tests/cases/conformance/expressions/commaOperator/commaOperatorOtherValidOperation.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + //Comma operator in for loop for (var i = 0, j = 10; i < j; i++, j--) { diff --git a/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandAnyType.ts b/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandAnyType.ts index e7facf1d1f6..be245dbd6bb 100644 --- a/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandAnyType.ts +++ b/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandAnyType.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + var ANY: any; var BOOLEAN: boolean; var NUMBER: number; diff --git a/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandBooleanType.ts b/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandBooleanType.ts index 3e40a944398..4fe7df9c1a5 100644 --- a/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandBooleanType.ts +++ b/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandBooleanType.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + var ANY: any; var BOOLEAN: boolean; var NUMBER: number; diff --git a/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandNumberType.ts b/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandNumberType.ts index 63d41558b58..a87e2f68608 100644 --- a/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandNumberType.ts +++ b/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandNumberType.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + var ANY: any; var BOOLEAN: boolean; var NUMBER: number; diff --git a/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandObjectType.ts b/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandObjectType.ts index 3ef1fdbf433..0a6a47dfbbf 100644 --- a/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandObjectType.ts +++ b/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandObjectType.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + var ANY: any; var BOOLEAN: boolean; var NUMBER: number; diff --git a/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandStringType.ts b/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandStringType.ts index 183c5a6373c..0678d956156 100644 --- a/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandStringType.ts +++ b/tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandStringType.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + var ANY: any; var BOOLEAN: boolean; var NUMBER: number; diff --git a/tests/cases/conformance/expressions/commaOperator/commaOperatorsMultipleOperators.ts b/tests/cases/conformance/expressions/commaOperator/commaOperatorsMultipleOperators.ts index 53dd34d3e46..75e67a666dc 100644 --- a/tests/cases/conformance/expressions/commaOperator/commaOperatorsMultipleOperators.ts +++ b/tests/cases/conformance/expressions/commaOperator/commaOperatorsMultipleOperators.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + var ANY: any; var BOOLEAN: boolean; var NUMBER: number; diff --git a/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts b/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts index 49e462d9ca0..115706d5d37 100644 --- a/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts +++ b/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + // ~ operator on any type var ANY: any; diff --git a/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithBooleanType.ts b/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithBooleanType.ts index 55d7132461d..3235901d622 100644 --- a/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithBooleanType.ts +++ b/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithBooleanType.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + // ~ operator on boolean type var BOOLEAN: boolean; diff --git a/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithEnumType.ts b/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithEnumType.ts index 60370469692..411ff69fa82 100644 --- a/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithEnumType.ts +++ b/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithEnumType.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + // ~ operator on enum type enum ENUM1 { A, B, "" }; diff --git a/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithNumberType.ts b/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithNumberType.ts index 0dfc3527693..b41a114503d 100644 --- a/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithNumberType.ts +++ b/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithNumberType.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + // ~ operator on number type var NUMBER: number; var NUMBER1: number[] = [1, 2]; diff --git a/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithStringType.ts b/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithStringType.ts index 44cb88e2cd5..0b60c73ef94 100644 --- a/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithStringType.ts +++ b/tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithStringType.ts @@ -1,3 +1,5 @@ +// @allowUnreachableCode: true + // ~ operator on string type var STRING: string; var STRING1: string[] = ["", "abc"]; diff --git a/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts index 167369a020b..febb09b2c51 100644 --- a/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts +++ b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator01.ts @@ -1,3 +1,4 @@ +// @allowUnreachableCode: true // @noImplicitAny: true let x: (a: string) => string; diff --git a/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts index 11e743b583e..bc88a6bcda8 100644 --- a/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts +++ b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator02.ts @@ -1,3 +1,4 @@ +// @allowUnreachableCode: true // @noImplicitAny: true let x: (a: string) => string; diff --git a/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator03.ts b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator03.ts index 321eb99d153..e558a02e324 100644 --- a/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator03.ts +++ b/tests/cases/conformance/types/contextualTypes/commaOperator/contextuallyTypeCommaOperator03.ts @@ -1,3 +1,4 @@ +// @allowUnreachableCode: true // @noImplicitAny: true let x: (a: string) => string; From add7c1a6647bcd97cf6e45f7a59b75583c4c713b Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Tue, 13 Sep 2016 11:50:37 -0700 Subject: [PATCH 3/6] Flip check, add SEF cases --- src/compiler/checker.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c06cf679f6d..6eddd2c6a20 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13257,6 +13257,8 @@ namespace ts { case SyntaxKind.Identifier: case SyntaxKind.StringLiteral: case SyntaxKind.RegularExpressionLiteral: + case SyntaxKind.TaggedTemplateExpression: + case SyntaxKind.TemplateExpression: case SyntaxKind.NoSubstitutionTemplateLiteral: case SyntaxKind.NumericLiteral: case SyntaxKind.TrueKeyword: @@ -13264,6 +13266,7 @@ namespace ts { case SyntaxKind.NullKeyword: case SyntaxKind.UndefinedKeyword: case SyntaxKind.FunctionExpression: + case SyntaxKind.ClassExpression: case SyntaxKind.ArrowFunction: case SyntaxKind.ArrayLiteralExpression: case SyntaxKind.ObjectLiteralExpression: @@ -13465,7 +13468,7 @@ namespace ts { checkAssignmentOperator(rightType); return getRegularTypeOfObjectLiteral(rightType); case SyntaxKind.CommaToken: - if (isSideEffectFree(left) && !compilerOptions.allowUnreachableCode) { + if (!compilerOptions.allowUnreachableCode && isSideEffectFree(left)) { error(left, Diagnostics.Left_side_of_comma_operator_is_unused_and_has_no_side_effects); } return rightType; From 509de27908b6da490b66446ea334c50bae6385e8 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Tue, 13 Sep 2016 11:51:03 -0700 Subject: [PATCH 4/6] Baseline update --- ...icalNotOperatorWithAnyOtherType.errors.txt | 5 +- ...gicalNotOperatorWithBooleanType.errors.txt | 44 +++++++++++++ .../logicalNotOperatorWithEnumType.errors.txt | 27 ++++++++ ...ogicalNotOperatorWithNumberType.errors.txt | 51 +++++++++++++++ ...ogicalNotOperatorWithStringType.errors.txt | 50 +++++++++++++++ .../negateOperatorWithAnyOtherType.errors.txt | 59 +++++++++++++++++ .../negateOperatorWithBooleanType.errors.txt | 41 ++++++++++++ .../negateOperatorWithEnumType.errors.txt | 23 +++++++ .../negateOperatorWithNumberType.errors.txt | 47 ++++++++++++++ .../negateOperatorWithStringType.errors.txt | 46 ++++++++++++++ .../newOperatorErrorCases.errors.txt | 5 +- .../parenthesizedContexualTyping1.errors.txt | 44 +++++++++++++ .../parenthesizedContexualTyping2.errors.txt | 51 +++++++++++++++ .../reference/parser512325.errors.txt | 8 ++- .../parserArrowFunctionExpression4.errors.txt | 5 +- .../parserCastVersusArrowFunction1.errors.txt | 5 +- .../parserComputedPropertyName35.errors.txt | 5 +- ...RecoveryArrayLiteralExpression3.errors.txt | 8 ++- ...parserTernaryAndCommaOperators1.errors.txt | 5 +- .../plusOperatorWithAnyOtherType.errors.txt | 5 +- .../plusOperatorWithBooleanType.errors.txt | 41 ++++++++++++ .../plusOperatorWithEnumType.errors.txt | 24 +++++++ .../plusOperatorWithNumberType.errors.txt | 47 ++++++++++++++ .../plusOperatorWithStringType.errors.txt | 46 ++++++++++++++ .../sourceMapValidationFor.errors.txt | 5 +- ...gLiteralsWithSwitchStatements03.errors.txt | 8 ++- ...gLiteralsWithSwitchStatements04.errors.txt | 14 ++++- .../reference/systemModule16.errors.txt | 14 ++++- tests/baselines/reference/tsxEmit3.errors.txt | 56 +++++++++++++++++ .../typecheckCommaExpression.errors.txt | 5 +- .../typeofOperatorWithAnyOtherType.errors.txt | 5 +- .../typeofOperatorWithBooleanType.errors.txt | 57 +++++++++++++++++ .../typeofOperatorWithEnumType.errors.txt | 34 ++++++++++ .../typeofOperatorWithNumberType.errors.txt | 63 +++++++++++++++++++ .../typeofOperatorWithStringType.errors.txt | 5 +- .../reference/widenedTypes.errors.txt | 5 +- tests/baselines/reference/witness.errors.txt | 20 +++++- 37 files changed, 965 insertions(+), 18 deletions(-) create mode 100644 tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt create mode 100644 tests/baselines/reference/logicalNotOperatorWithEnumType.errors.txt create mode 100644 tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt create mode 100644 tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt create mode 100644 tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt create mode 100644 tests/baselines/reference/negateOperatorWithBooleanType.errors.txt create mode 100644 tests/baselines/reference/negateOperatorWithEnumType.errors.txt create mode 100644 tests/baselines/reference/negateOperatorWithNumberType.errors.txt create mode 100644 tests/baselines/reference/negateOperatorWithStringType.errors.txt create mode 100644 tests/baselines/reference/parenthesizedContexualTyping1.errors.txt create mode 100644 tests/baselines/reference/parenthesizedContexualTyping2.errors.txt create mode 100644 tests/baselines/reference/plusOperatorWithBooleanType.errors.txt create mode 100644 tests/baselines/reference/plusOperatorWithEnumType.errors.txt create mode 100644 tests/baselines/reference/plusOperatorWithNumberType.errors.txt create mode 100644 tests/baselines/reference/plusOperatorWithStringType.errors.txt create mode 100644 tests/baselines/reference/tsxEmit3.errors.txt create mode 100644 tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt create mode 100644 tests/baselines/reference/typeofOperatorWithEnumType.errors.txt create mode 100644 tests/baselines/reference/typeofOperatorWithNumberType.errors.txt diff --git a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt index 883f2ee5861..e8a9b49f444 100644 --- a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt @@ -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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. !objA.a; !M.n; \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt new file mode 100644 index 00000000000..fbd7aa599b8 --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt @@ -0,0 +1,44 @@ +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithBooleanType.ts(36,1): error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. + !objA.a; + !M.n; \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithEnumType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithEnumType.errors.txt new file mode 100644 index 00000000000..eeb7b30e71c --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithEnumType.errors.txt @@ -0,0 +1,27 @@ +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithEnumType.ts(21,1): error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt new file mode 100644 index 00000000000..54aac1cb05f --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt @@ -0,0 +1,51 @@ +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithNumberType.ts(45,1): error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt new file mode 100644 index 00000000000..1d84af9ec61 --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt @@ -0,0 +1,50 @@ +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithStringType.ts(44,1): error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt new file mode 100644 index 00000000000..e3ed170cd98 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt @@ -0,0 +1,59 @@ +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts(51,1): error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. + -objA.a; + -M.n; \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithBooleanType.errors.txt b/tests/baselines/reference/negateOperatorWithBooleanType.errors.txt new file mode 100644 index 00000000000..69f382f3c60 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithBooleanType.errors.txt @@ -0,0 +1,41 @@ +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithBooleanType.ts(33,1): error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. + -objA.a; + -M.n; \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithEnumType.errors.txt b/tests/baselines/reference/negateOperatorWithEnumType.errors.txt new file mode 100644 index 00000000000..9666a49e104 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithEnumType.errors.txt @@ -0,0 +1,23 @@ +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithEnumType.ts(17,1): error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithNumberType.errors.txt b/tests/baselines/reference/negateOperatorWithNumberType.errors.txt new file mode 100644 index 00000000000..b6ea6c0f288 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithNumberType.errors.txt @@ -0,0 +1,47 @@ +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithNumberType.ts(41,1): error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithStringType.errors.txt b/tests/baselines/reference/negateOperatorWithStringType.errors.txt new file mode 100644 index 00000000000..7eb59e5b2ca --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithStringType.errors.txt @@ -0,0 +1,46 @@ +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithStringType.ts(40,1): error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/newOperatorErrorCases.errors.txt b/tests/baselines/reference/newOperatorErrorCases.errors.txt index 11a6beb1d39..364caa5f48d 100644 --- a/tests/baselines/reference/newOperatorErrorCases.errors.txt +++ b/tests/baselines/reference/newOperatorErrorCases.errors.txt @@ -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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. // Generic construct expression with no parentheses var c1 = new T; diff --git a/tests/baselines/reference/parenthesizedContexualTyping1.errors.txt b/tests/baselines/reference/parenthesizedContexualTyping1.errors.txt new file mode 100644 index 00000000000..01b3fe8dadd --- /dev/null +++ b/tests/baselines/reference/parenthesizedContexualTyping1.errors.txt @@ -0,0 +1,44 @@ +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(28,32): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(28,56): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(29,33): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(29,57): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts (4 errors) ==== + + function fun(g: (x: T) => T, x: T): T; + function fun(g: (x: T) => T, h: (y: T) => T, x: T): T; + function fun(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 TS2693: Left side of comma operator is unused and has no side effects. + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + var obj2: ObjType = ({ x: x => (x, undefined), y: y => (y, undefined) }); + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/parenthesizedContexualTyping2.errors.txt b/tests/baselines/reference/parenthesizedContexualTyping2.errors.txt new file mode 100644 index 00000000000..0aaa0ebead7 --- /dev/null +++ b/tests/baselines/reference/parenthesizedContexualTyping2.errors.txt @@ -0,0 +1,51 @@ +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(35,32): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(35,56): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(36,33): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(36,57): error TS2693: 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: (p: T) => T) => typeof x; + + function fun(f: FuncType, x: T): T; + function fun(f: FuncType, g: FuncType, x: T): T; + function fun(...rest: any[]): T { + return undefined; + } + + var a = fun(x => { x(undefined); return x; }, 10); + var b = fun((x => { x(undefined); return x; }), 10); + var c = fun(((x => { x(undefined); return x; })), 10); + var d = fun((((x => { x(undefined); return x; }))), 10); + + var e = fun(x => { x(undefined); return x; }, x => { x(undefined); return x; }, 10); + var f = fun((x => { x(undefined); return x; }),(x => { x(undefined); return x; }), 10); + var g = fun(((x => { x(undefined); return x; })),((x => { x(undefined); return x; })), 10); + var h = fun((((x => { x(undefined); return x; }))),((x => { x(undefined); return x; })), 10); + + // Ternaries in parens + var i = fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x => undefined), 10); + var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), 10); + var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), x => { x(undefined); return x; }, 10); + var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined)))),((x => { x(undefined); return x; })), 10); + + var lambda1: FuncType = x => { x(undefined); return x; }; + var lambda2: FuncType = (x => { x(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 TS2693: Left side of comma operator is unused and has no side effects. + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + var obj2: ObjType = ({ x: x => (x, undefined), y: y => (y, undefined) }); + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/parser512325.errors.txt b/tests/baselines/reference/parser512325.errors.txt index 57e75d2beff..c6bdd812d08 100644 --- a/tests/baselines/reference/parser512325.errors.txt +++ b/tests/baselines/reference/parser512325.errors.txt @@ -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 TS2693: 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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'b'. + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'c'. ~~ diff --git a/tests/baselines/reference/parserArrowFunctionExpression4.errors.txt b/tests/baselines/reference/parserArrowFunctionExpression4.errors.txt index 9e04f60139d..3a32940d4fa 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression4.errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression4.errors.txt @@ -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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'a'. \ No newline at end of file diff --git a/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt b/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt index 6faa7934898..10d199c1569 100644 --- a/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt +++ b/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt @@ -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 TS2693: 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 = () => 1; var v = 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 TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'b'. var v = (a = 1, b = 2); diff --git a/tests/baselines/reference/parserComputedPropertyName35.errors.txt b/tests/baselines/reference/parserComputedPropertyName35.errors.txt index e603d1c73fd..48831c7bb3d 100644 --- a/tests/baselines/reference/parserComputedPropertyName35.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName35.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts(2,6): error TS2693: 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 TS2693: 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. } \ No newline at end of file diff --git a/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt b/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt index 69997baef28..66d175c7d4a 100644 --- a/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt +++ b/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt @@ -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 TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts(2,56): error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserTernaryAndCommaOperators1.errors.txt b/tests/baselines/reference/parserTernaryAndCommaOperators1.errors.txt index 3efccba3359..0b7942830f4 100644 --- a/tests/baselines/reference/parserTernaryAndCommaOperators1.errors.txt +++ b/tests/baselines/reference/parserTernaryAndCommaOperators1.errors.txt @@ -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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'c'. ~ diff --git a/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt index bc76e073234..d26c3b1df8e 100644 --- a/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt @@ -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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. +objA.a; +M.n; \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithBooleanType.errors.txt b/tests/baselines/reference/plusOperatorWithBooleanType.errors.txt new file mode 100644 index 00000000000..9390c92ce38 --- /dev/null +++ b/tests/baselines/reference/plusOperatorWithBooleanType.errors.txt @@ -0,0 +1,41 @@ +tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithBooleanType.ts(33,1): error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. + +objA.a; + +M.n; \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithEnumType.errors.txt b/tests/baselines/reference/plusOperatorWithEnumType.errors.txt new file mode 100644 index 00000000000..d1277867ca9 --- /dev/null +++ b/tests/baselines/reference/plusOperatorWithEnumType.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithEnumType.ts(18,1): error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithNumberType.errors.txt b/tests/baselines/reference/plusOperatorWithNumberType.errors.txt new file mode 100644 index 00000000000..c245a04eb69 --- /dev/null +++ b/tests/baselines/reference/plusOperatorWithNumberType.errors.txt @@ -0,0 +1,47 @@ +tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithNumberType.ts(41,1): error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithStringType.errors.txt b/tests/baselines/reference/plusOperatorWithStringType.errors.txt new file mode 100644 index 00000000000..979da03c1bd --- /dev/null +++ b/tests/baselines/reference/plusOperatorWithStringType.errors.txt @@ -0,0 +1,46 @@ +tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithStringType.ts(40,1): error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFor.errors.txt b/tests/baselines/reference/sourceMapValidationFor.errors.txt index 6949d7545ed..d665ff8ec93 100644 --- a/tests/baselines/reference/sourceMapValidationFor.errors.txt +++ b/tests/baselines/reference/sourceMapValidationFor.errors.txt @@ -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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. } \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt b/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt index c5aedb81334..6e06101ec77 100644 --- a/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt +++ b/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt @@ -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 TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(14,11): error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. + ~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. x; y; break; diff --git a/tests/baselines/reference/stringLiteralsWithSwitchStatements04.errors.txt b/tests/baselines/reference/stringLiteralsWithSwitchStatements04.errors.txt index 10a461c753a..c8626674f89 100644 --- a/tests/baselines/reference/stringLiteralsWithSwitchStatements04.errors.txt +++ b/tests/baselines/reference/stringLiteralsWithSwitchStatements04.errors.txt @@ -1,7 +1,11 @@ +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(7,10): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(9,10): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(11,10): error TS2693: 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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. break; case x, "foo": + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. break; case x, "baz": + ~ +!!! error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. break; case "baz" && "bar": break; diff --git a/tests/baselines/reference/systemModule16.errors.txt b/tests/baselines/reference/systemModule16.errors.txt index 8c79c9218e4..e9ed4f3ab86 100644 --- a/tests/baselines/reference/systemModule16.errors.txt +++ b/tests/baselines/reference/systemModule16.errors.txt @@ -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 TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/systemModule16.ts(11,1): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/systemModule16.ts(11,1): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/systemModule16.ts(11,1): error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. + ~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + ~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + ~~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/tsxEmit3.errors.txt b/tests/baselines/reference/tsxEmit3.errors.txt new file mode 100644 index 00000000000..1fe8a566f81 --- /dev/null +++ b/tests/baselines/reference/tsxEmit3.errors.txt @@ -0,0 +1,56 @@ +tests/cases/conformance/jsx/file.tsx(19,2): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/jsx/file.tsx(23,3): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/jsx/file.tsx(26,3): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/jsx/file.tsx(39,2): error TS2693: 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, ; + } + } + + module M { + // Emit M.Foo + Foo, ; + ~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + + export module S { + // Emit M.Foo + Foo, ; + ~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + + // Emit S.Bar + Bar, ; + ~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + } + + } + + module M { + // Emit M.S.Bar + S.Bar, ; + } + + module M { + var M = 100; + // Emit M_1.Foo + Foo, ; + ~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + } + \ No newline at end of file diff --git a/tests/baselines/reference/typecheckCommaExpression.errors.txt b/tests/baselines/reference/typecheckCommaExpression.errors.txt index 96c9d4be45c..349236d12d7 100644 --- a/tests/baselines/reference/typecheckCommaExpression.errors.txt +++ b/tests/baselines/reference/typecheckCommaExpression.errors.txt @@ -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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt index f9394c622c0..c11047330c4 100644 --- a/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt @@ -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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. typeof obj1; typeof obj1.x; typeof objA.a; diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt b/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt new file mode 100644 index 00000000000..b6e33e440f1 --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt @@ -0,0 +1,57 @@ +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts(37,1): error TS2693: 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 TS2693: 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; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt b/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt new file mode 100644 index 00000000000..c7291544b1e --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt @@ -0,0 +1,34 @@ +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts(23,1): error TS2693: 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 TS2693: 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; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt b/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt new file mode 100644 index 00000000000..e5604e1efd8 --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt @@ -0,0 +1,63 @@ +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts(45,1): error TS2693: 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 TS2693: 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; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithStringType.errors.txt b/tests/baselines/reference/typeofOperatorWithStringType.errors.txt index bd891c949a3..867703e47c3 100644 --- a/tests/baselines/reference/typeofOperatorWithStringType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithStringType.errors.txt @@ -1,3 +1,4 @@ +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(44,1): error TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. // use typeof in type query var z: string; diff --git a/tests/baselines/reference/widenedTypes.errors.txt b/tests/baselines/reference/widenedTypes.errors.txt index bca850b9178..e4bc3e70dff 100644 --- a/tests/baselines/reference/widenedTypes.errors.txt +++ b/tests/baselines/reference/widenedTypes.errors.txt @@ -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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. t[3] = ""; ~~~~ !!! error TS2322: Type '""' is not assignable to type 'number'. diff --git a/tests/baselines/reference/witness.errors.txt b/tests/baselines/reference/witness.errors.txt index b60e685e3dd..420298f5e45 100644 --- a/tests/baselines/reference/witness.errors.txt +++ b/tests/baselines/reference/witness.errors.txt @@ -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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/witness/witness.ts(34,12): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/witness/witness.ts(36,12): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/witness/witness.ts(36,12): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/witness/witness.ts(36,12): error TS2693: 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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. + ~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. var co2: any; var co3 = (co1, co2, co3, co1); + ~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + ~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + ~~~~~~~~~~~~~ +!!! error TS2693: 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'. From 8cadf56996b71582abfc11517b044fcf0fed8a4f Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Tue, 13 Sep 2016 11:51:56 -0700 Subject: [PATCH 5/6] Add JSX to SEF exprs --- src/compiler/checker.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 6eddd2c6a20..3f5306f9e7b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13272,6 +13272,8 @@ namespace ts { case SyntaxKind.ObjectLiteralExpression: case SyntaxKind.TypeOfExpression: case SyntaxKind.NonNullExpression: + case SyntaxKind.JsxSelfClosingElement: + case SyntaxKind.JsxElement: return true; case SyntaxKind.ConditionalExpression: From 6a899721ba97217235d343522f3d43e365402630 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Wed, 14 Sep 2016 10:02:00 -0700 Subject: [PATCH 6/6] Lint --- src/compiler/checker.ts | 2 +- ...nmentToParenthesizedExpression1.errors.txt | 4 +- .../reference/commaOperator1.errors.txt | 32 +++---- .../commaOperatorLeftSideUnused.errors.txt | 92 +++++++++---------- .../commaOperatorWithoutOperand.errors.txt | 44 ++++----- ...tructuringParameterDeclaration6.errors.txt | 8 +- ...rowfunctionsOptionalArgsErrors2.errors.txt | 16 ++-- .../jsxEsprimaFbTestSuite.errors.txt | 5 +- .../jsxInvalidEsprimaTestSuite.errors.txt | 5 +- ...icalNotOperatorWithAnyOtherType.errors.txt | 4 +- ...gicalNotOperatorWithBooleanType.errors.txt | 4 +- .../logicalNotOperatorWithEnumType.errors.txt | 4 +- ...ogicalNotOperatorWithNumberType.errors.txt | 4 +- ...ogicalNotOperatorWithStringType.errors.txt | 4 +- .../negateOperatorWithAnyOtherType.errors.txt | 4 +- .../negateOperatorWithBooleanType.errors.txt | 4 +- .../negateOperatorWithEnumType.errors.txt | 4 +- .../negateOperatorWithNumberType.errors.txt | 4 +- .../negateOperatorWithStringType.errors.txt | 4 +- .../newOperatorErrorCases.errors.txt | 4 +- .../parenthesizedContexualTyping1.errors.txt | 16 ++-- .../parenthesizedContexualTyping2.errors.txt | 16 ++-- .../reference/parser512325.errors.txt | 8 +- .../parserArrowFunctionExpression4.errors.txt | 4 +- .../parserCastVersusArrowFunction1.errors.txt | 4 +- .../parserComputedPropertyName35.errors.txt | 4 +- ...RecoveryArrayLiteralExpression3.errors.txt | 8 +- ...parserTernaryAndCommaOperators1.errors.txt | 4 +- .../plusOperatorWithAnyOtherType.errors.txt | 4 +- .../plusOperatorWithBooleanType.errors.txt | 4 +- .../plusOperatorWithEnumType.errors.txt | 4 +- .../plusOperatorWithNumberType.errors.txt | 4 +- .../plusOperatorWithStringType.errors.txt | 4 +- .../sourceMapValidationFor.errors.txt | 4 +- ...gLiteralsWithSwitchStatements03.errors.txt | 8 +- ...gLiteralsWithSwitchStatements04.errors.txt | 16 ++-- .../reference/systemModule16.errors.txt | 16 ++-- tests/baselines/reference/tsxEmit3.errors.txt | 16 ++-- .../reference/tsxErrorRecovery2.errors.txt | 10 +- .../reference/tsxErrorRecovery3.errors.txt | 10 +- .../typecheckCommaExpression.errors.txt | 4 +- .../typeofOperatorWithAnyOtherType.errors.txt | 4 +- .../typeofOperatorWithBooleanType.errors.txt | 4 +- .../typeofOperatorWithEnumType.errors.txt | 4 +- .../typeofOperatorWithNumberType.errors.txt | 4 +- .../typeofOperatorWithStringType.errors.txt | 4 +- .../reference/widenedTypes.errors.txt | 4 +- tests/baselines/reference/witness.errors.txt | 24 ++--- 48 files changed, 243 insertions(+), 225 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7ab785d2909..c82e0ece074 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -13321,7 +13321,7 @@ namespace ts { 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 diff --git a/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt b/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt index 3dbadea09e2..0a411828bf9 100644 --- a/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt +++ b/tests/baselines/reference/assignmentToParenthesizedExpression1.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/assignmentToParenthesizedExpression1.ts(2,1): error TS2364: Invalid left-hand side of assignment expression. -tests/cases/compiler/assignmentToParenthesizedExpression1.ts(2,2): error TS2693: Left side of comma operator is unused and has no side effects. +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 (2 errors) ==== @@ -8,4 +8,4 @@ tests/cases/compiler/assignmentToParenthesizedExpression1.ts(2,2): error TS2693: ~~~~~~ !!! error TS2364: Invalid left-hand side of assignment expression. ~ -!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/commaOperator1.errors.txt b/tests/baselines/reference/commaOperator1.errors.txt index 0a2c7ad1c80..5090dd9496c 100644 --- a/tests/baselines/reference/commaOperator1.errors.txt +++ b/tests/baselines/reference/commaOperator1.errors.txt @@ -1,33 +1,33 @@ -tests/cases/compiler/commaOperator1.ts(1,11): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperator1.ts(1,11): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperator1.ts(1,11): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperator1.ts(1,12): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperator1.ts(1,12): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperator1.ts(1,29): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperator1.ts(4,12): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperator1.ts(4,12): error TS2693: 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,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 TS2693: 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 TS2693: 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 TS2693: 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 TS2693: 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 TS2693: 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 TS2693: 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 TS2693: 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 TS2693: 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. } \ No newline at end of file diff --git a/tests/baselines/reference/commaOperatorLeftSideUnused.errors.txt b/tests/baselines/reference/commaOperatorLeftSideUnused.errors.txt index 8f8be40f0ac..3701a4add33 100644 --- a/tests/baselines/reference/commaOperatorLeftSideUnused.errors.txt +++ b/tests/baselines/reference/commaOperatorLeftSideUnused.errors.txt @@ -1,26 +1,26 @@ -tests/cases/compiler/commaOperatorLeftSideUnused.ts(8,10): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(16,19): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(19,21): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(22,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(23,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(24,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(25,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(26,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(27,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(28,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(29,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(30,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(31,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(32,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(33,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(34,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(35,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(36,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(37,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(38,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(39,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(40,7): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/commaOperatorLeftSideUnused.ts(41,7): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -33,7 +33,7 @@ tests/cases/compiler/commaOperatorLeftSideUnused.ts(41,7): error TS2693: Left si // Should error case 0, 1: ~ -!!! error TS2693: 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. return 'zero or one'; default: return 'more than one'; @@ -43,74 +43,74 @@ tests/cases/compiler/commaOperatorLeftSideUnused.ts(41,7): error TS2693: Left si // Should error let x = Math.pow((3, 5), 2); ~ -!!! error TS2693: 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. // Should error let a = [(3 + 4), ((1 + 1, 8) * 4)]; ~~~~~ -!!! error TS2693: 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 cases xx = (1, 2); ~ -!!! error TS2693: 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. xx = ('', xx); ~~ -!!! error TS2693: 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. xx = (/323/, 5); ~~~~~ -!!! error TS2693: 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. xx = (`wat`, 'ok'), ~~~~~ -!!! error TS2693: 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. xx = (true, false); ~~~~ -!!! error TS2693: 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. xx = (false, true); ~~~~~ -!!! error TS2693: 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. xx = (null, xx); ~~~~ -!!! error TS2693: 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. xx = (undefined, 10); ~~~~~~~~~ -!!! error TS2693: 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. xx = (() => {}, 'no'); ~~~~~~~~ -!!! error TS2693: 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. xx = (function() { }, 100); ~~~~~~~~ -!!! error TS2693: 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. xx = ({}, {}); ~~ -!!! error TS2693: 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. xx = (typeof xx, 'unused'); ~~~~~~~~~ -!!! error TS2693: 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. xx = ([1, 2, x++], xx); ~~~~~~~~~~~ -!!! error TS2693: 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. xx = (xx!, xx); ~~~ -!!! error TS2693: 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. xx = (xx ? 3 : 4, 10); ~~~~~~~~~~ -!!! error TS2693: 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. xx = (3 + 4, 10); ~~~~~ -!!! error TS2693: 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. xx = (!xx, 10); ~~~ -!!! error TS2693: 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. xx = (~xx, 10); ~~~ -!!! error TS2693: 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. xx = (-xx, 10); ~~~ -!!! error TS2693: 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. xx = (+xx, 10); ~~~ -!!! error TS2693: 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. // OK cases xx = (xx ? x++ : 4, 10); diff --git a/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt b/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt index 83da6522917..4167e2d426c 100644 --- a/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt +++ b/tests/baselines/reference/commaOperatorWithoutOperand.errors.txt @@ -1,24 +1,24 @@ -tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(9,2): error TS2693: Left side of comma operator is unused and has no side effects. +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 TS2693: Left side of comma operator is unused and has no side effects. +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 TS2693: Left side of comma operator is unused and has no side effects. +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 TS2693: Left side of comma operator is unused and has no side effects. +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 TS2693: Left side of comma operator is unused and has no side effects. +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 TS2693: Left side of comma operator is unused and has no side effects. +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 TS2693: Left side of comma operator is unused and has no side effects. +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 TS2693: Left side of comma operator is unused and has no side effects. +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 TS2693: Left side of comma operator is unused and has no side effects. +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 TS2693: Left side of comma operator is unused and has no side effects. +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 TS2693: Left side of comma operator is unused and has no side effects. +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. @@ -34,61 +34,61 @@ tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts // Missing the second operand (ANY, ); ~~~ -!!! error TS2693: 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 TS1109: Expression expected. (BOOLEAN, ); ~~~~~~~ -!!! error TS2693: 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 TS1109: Expression expected. (NUMBER, ); ~~~~~~ -!!! error TS2693: 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 TS1109: Expression expected. (STRING, ); ~~~~~~ -!!! error TS2693: 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 TS1109: Expression expected. (OBJECT, ); ~~~~~~ -!!! error TS2693: 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 TS1109: Expression expected. // Missing the first operand (, ANY); -!!! error TS2693: 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 TS1109: Expression expected. (, BOOLEAN); -!!! error TS2693: 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 TS1109: Expression expected. (, NUMBER); -!!! error TS2693: 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 TS1109: Expression expected. (, STRING); -!!! error TS2693: 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 TS1109: Expression expected. (, OBJECT); -!!! error TS2693: 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 TS1109: Expression expected. // Missing all operands ( , ); -!!! error TS2693: 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 TS1109: Expression expected. ~ diff --git a/tests/baselines/reference/destructuringParameterDeclaration6.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration6.errors.txt index c7594d3aa1c..cecb5d473c2 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration6.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration6.errors.txt @@ -1,9 +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 TS2693: Left side of comma operator is unused and has no side effects. +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 TS2693: Left side of comma operator is unused and has no side effects. +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. @@ -28,13 +28,13 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts( ~~~~~ !!! error TS1181: Array element destructuring pattern expected. -!!! error TS2693: 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. ~~~ !!! error TS1109: Expression expected. -!!! error TS2693: 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. ~~~~~~ diff --git a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt index 5f2b5db53bc..b435e7773f5 100644 --- a/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt +++ b/tests/baselines/reference/fatarrowfunctionsOptionalArgsErrors2.errors.txt @@ -1,14 +1,14 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,12): error TS2304: Cannot find name 'a'. -tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(1,12): error TS2693: Left side of comma operator is unused and has no side effects. +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 TS2693: Left side of comma operator is unused and has no side effects. +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 TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(2,12): error TS2693: 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,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'. @@ -26,11 +26,11 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,20): error TS2304 ~ !!! error TS2304: Cannot find name 'a'. ~ -!!! error TS2693: 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 'b'. ~ -!!! error TS2693: 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 'c'. ~~ @@ -43,9 +43,9 @@ tests/cases/compiler/fatarrowfunctionsOptionalArgsErrors2.ts(4,20): error TS2304 !!! error TS2304: Cannot find name 'c'. var tt2 = ((a), b, c) => a+b+c; ~~~ -!!! error TS2693: 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 TS2693: 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'. ~ diff --git a/tests/baselines/reference/jsxEsprimaFbTestSuite.errors.txt b/tests/baselines/reference/jsxEsprimaFbTestSuite.errors.txt index 3a6059d8d07..23b14a25cd2 100644 --- a/tests/baselines/reference/jsxEsprimaFbTestSuite.errors.txt +++ b/tests/baselines/reference/jsxEsprimaFbTestSuite.errors.txt @@ -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

7x invalid-js-identifier
; right=monkeys /> gorillas />; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1005: '{' expected. ~~~~~ diff --git a/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt b/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt index 237c3399e88..4b415154c6b 100644 --- a/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt +++ b/tests/baselines/reference/jsxInvalidEsprimaTestSuite.errors.txt @@ -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: '; @@ -94,6 +95,8 @@ tests/cases/conformance/jsx/jsxInvalidEsprimaTestSuite.tsx(35,21): error TS1005: ~ !!! error TS1109: Expression expected. ; + ~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~ !!! error TS1005: '{' expected. ~ diff --git a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt index e8a9b49f444..02b4bf16fd2 100644 --- a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt @@ -1,7 +1,7 @@ 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 TS2693: Left side of comma operator is unused and has no side effects. +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 (4 errors) ==== @@ -69,6 +69,6 @@ tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNot !ANY2[0]; !ANY, ANY1; ~~~~ -!!! error TS2693: 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. !objA.a; !M.n; \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt index fbd7aa599b8..51666e4ea25 100644 --- a/tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt +++ b/tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithBooleanType.ts(36,1): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -39,6 +39,6 @@ tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNot !foo(); !true, false; ~~~~~ -!!! error TS2693: 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. !objA.a; !M.n; \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithEnumType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithEnumType.errors.txt index eeb7b30e71c..25298f1bd44 100644 --- a/tests/baselines/reference/logicalNotOperatorWithEnumType.errors.txt +++ b/tests/baselines/reference/logicalNotOperatorWithEnumType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithEnumType.ts(21,1): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -24,4 +24,4 @@ tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNot !ENUM.B; !ENUM, ENUM1; ~~~~~ -!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt index 54aac1cb05f..e1c1d5da153 100644 --- a/tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt +++ b/tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithNumberType.ts(45,1): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -48,4 +48,4 @@ tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNot !M.n; !objA.a, M.n; ~~~~~~~ -!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt index 1d84af9ec61..2eb70642fc2 100644 --- a/tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt +++ b/tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithStringType.ts(44,1): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -47,4 +47,4 @@ tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNot !foo(); !objA.a,M.n; ~~~~~~~ -!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt index e3ed170cd98..f008b4698ed 100644 --- a/tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts(51,1): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -54,6 +54,6 @@ tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperator -ANY2[0]; -ANY, ANY1; ~~~~ -!!! error TS2693: 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. -objA.a; -M.n; \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithBooleanType.errors.txt b/tests/baselines/reference/negateOperatorWithBooleanType.errors.txt index 69f382f3c60..5abbf8b8679 100644 --- a/tests/baselines/reference/negateOperatorWithBooleanType.errors.txt +++ b/tests/baselines/reference/negateOperatorWithBooleanType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithBooleanType.ts(33,1): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -36,6 +36,6 @@ tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperator -foo(); -true, false; ~~~~~ -!!! error TS2693: 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. -objA.a; -M.n; \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithEnumType.errors.txt b/tests/baselines/reference/negateOperatorWithEnumType.errors.txt index 9666a49e104..4d4608d40a5 100644 --- a/tests/baselines/reference/negateOperatorWithEnumType.errors.txt +++ b/tests/baselines/reference/negateOperatorWithEnumType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithEnumType.ts(17,1): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -20,4 +20,4 @@ tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperator -ENUM1["B"]; -ENUM, ENUM1; ~~~~~ -!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithNumberType.errors.txt b/tests/baselines/reference/negateOperatorWithNumberType.errors.txt index b6ea6c0f288..f5ca9813fdf 100644 --- a/tests/baselines/reference/negateOperatorWithNumberType.errors.txt +++ b/tests/baselines/reference/negateOperatorWithNumberType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithNumberType.ts(41,1): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -44,4 +44,4 @@ tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperator -M.n; -objA.a, M.n; ~~~~~~~ -!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithStringType.errors.txt b/tests/baselines/reference/negateOperatorWithStringType.errors.txt index 7eb59e5b2ca..c2c37b76832 100644 --- a/tests/baselines/reference/negateOperatorWithStringType.errors.txt +++ b/tests/baselines/reference/negateOperatorWithStringType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithStringType.ts(40,1): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -43,4 +43,4 @@ tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperator -foo(); -objA.a,M.n; ~~~~~~~ -!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/newOperatorErrorCases.errors.txt b/tests/baselines/reference/newOperatorErrorCases.errors.txt index 364caa5f48d..b2947a1d218 100644 --- a/tests/baselines/reference/newOperatorErrorCases.errors.txt +++ b/tests/baselines/reference/newOperatorErrorCases.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(27,16): error TS1005: ',' expected. -tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(27,16): error TS2693: Left side of comma operator is unused and has no side effects. +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. @@ -35,7 +35,7 @@ tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(37,9): ~~ !!! error TS1005: ',' expected. ~~ -!!! error TS2693: 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. // Generic construct expression with no parentheses var c1 = new T; diff --git a/tests/baselines/reference/parenthesizedContexualTyping1.errors.txt b/tests/baselines/reference/parenthesizedContexualTyping1.errors.txt index 01b3fe8dadd..c77d571f270 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping1.errors.txt +++ b/tests/baselines/reference/parenthesizedContexualTyping1.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(28,32): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(28,56): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(29,33): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(29,57): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -34,11 +34,11 @@ tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTypin type ObjType = { x: (p: number) => string; y: (p: string) => number }; var obj1: ObjType = { x: x => (x, undefined), y: y => (y, undefined) }; ~ -!!! error TS2693: 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 TS2693: 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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/parenthesizedContexualTyping2.errors.txt b/tests/baselines/reference/parenthesizedContexualTyping2.errors.txt index 0aaa0ebead7..e97a61cf532 100644 --- a/tests/baselines/reference/parenthesizedContexualTyping2.errors.txt +++ b/tests/baselines/reference/parenthesizedContexualTyping2.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(35,32): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(35,56): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(36,33): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(36,57): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -41,11 +41,11 @@ tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTypin type ObjType = { x: (p: number) => string; y: (p: string) => number }; var obj1: ObjType = { x: x => (x, undefined), y: y => (y, undefined) }; ~ -!!! error TS2693: 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 TS2693: 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 TS2693: 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 TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/parser512325.errors.txt b/tests/baselines/reference/parser512325.errors.txt index c6bdd812d08..e6a47fbf226 100644 --- a/tests/baselines/reference/parser512325.errors.txt +++ b/tests/baselines/reference/parser512325.errors.txt @@ -1,7 +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 TS2693: Left side of comma operator is unused and has no side effects. +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 TS2693: Left side of comma operator is unused and has no side effects. +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'. @@ -14,11 +14,11 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,29) ~ !!! error TS2304: Cannot find name 'a'. ~ -!!! error TS2693: 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 'b'. ~ -!!! error TS2693: 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 'c'. ~~ diff --git a/tests/baselines/reference/parserArrowFunctionExpression4.errors.txt b/tests/baselines/reference/parserArrowFunctionExpression4.errors.txt index 3a32940d4fa..6fd839315d4 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression4.errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression4.errors.txt @@ -1,5 +1,5 @@ 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 TS2693: Left side of comma operator is unused and has no side effects. +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'. @@ -8,6 +8,6 @@ tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowF ~ !!! error TS2304: Cannot find name 'a'. ~~~~~~~~~ -!!! error TS2693: 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'. \ No newline at end of file diff --git a/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt b/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt index 10d199c1569..e2d90538b8c 100644 --- a/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt +++ b/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt @@ -7,7 +7,7 @@ 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 TS2693: Left side of comma operator is unused and has no side effects. +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'. @@ -43,7 +43,7 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunctio ~ !!! error TS2304: Cannot find name 'a'. ~ -!!! error TS2693: 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 'b'. var v = (a = 1, b = 2); diff --git a/tests/baselines/reference/parserComputedPropertyName35.errors.txt b/tests/baselines/reference/parserComputedPropertyName35.errors.txt index 48831c7bb3d..39afa0999b8 100644 --- a/tests/baselines/reference/parserComputedPropertyName35.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName35.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts(2,6): error TS2693: Left side of comma operator is unused and has no side effects. +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. @@ -6,7 +6,7 @@ tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedP var x = { [0, 1]: { } ~ -!!! error TS2693: 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 TS1171: A comma expression is not allowed in a computed property name. } \ No newline at end of file diff --git a/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt b/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt index 66d175c7d4a..e34e8b6072a 100644 --- a/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt +++ b/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt @@ -1,6 +1,6 @@ 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 TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts(2,56): error TS2693: 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,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. @@ -10,9 +10,9 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions ~ !!! error TS1005: ',' expected. ~~~~~~~~~ -!!! error TS2693: 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 TS2693: 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. \ No newline at end of file diff --git a/tests/baselines/reference/parserTernaryAndCommaOperators1.errors.txt b/tests/baselines/reference/parserTernaryAndCommaOperators1.errors.txt index 0b7942830f4..38b163f3188 100644 --- a/tests/baselines/reference/parserTernaryAndCommaOperators1.errors.txt +++ b/tests/baselines/reference/parserTernaryAndCommaOperators1.errors.txt @@ -1,5 +1,5 @@ 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 TS2693: Left side of comma operator is unused and has no side effects. +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'. @@ -9,7 +9,7 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndComma ~ !!! error TS2304: Cannot find name 'b'. ~~~~~~~~~~~~~ -!!! error TS2693: 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 'c'. ~ diff --git a/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt index d26c3b1df8e..6c0f113b17b 100644 --- a/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt @@ -1,7 +1,7 @@ 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 TS2693: Left side of comma operator is unused and has no side effects. +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 (4 errors) ==== @@ -66,6 +66,6 @@ tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWith +ANY2[0]; +ANY, ANY1; ~~~~ -!!! error TS2693: 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. +objA.a; +M.n; \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithBooleanType.errors.txt b/tests/baselines/reference/plusOperatorWithBooleanType.errors.txt index 9390c92ce38..4a27aa50e05 100644 --- a/tests/baselines/reference/plusOperatorWithBooleanType.errors.txt +++ b/tests/baselines/reference/plusOperatorWithBooleanType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithBooleanType.ts(33,1): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -36,6 +36,6 @@ tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWith +foo(); +true, false; ~~~~~ -!!! error TS2693: 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. +objA.a; +M.n; \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithEnumType.errors.txt b/tests/baselines/reference/plusOperatorWithEnumType.errors.txt index d1277867ca9..a7fed5b29a4 100644 --- a/tests/baselines/reference/plusOperatorWithEnumType.errors.txt +++ b/tests/baselines/reference/plusOperatorWithEnumType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithEnumType.ts(18,1): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -21,4 +21,4 @@ tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWith +ENUM1.B; +ENUM, ENUM1; ~~~~~ -!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithNumberType.errors.txt b/tests/baselines/reference/plusOperatorWithNumberType.errors.txt index c245a04eb69..9abbe156e0f 100644 --- a/tests/baselines/reference/plusOperatorWithNumberType.errors.txt +++ b/tests/baselines/reference/plusOperatorWithNumberType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithNumberType.ts(41,1): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -44,4 +44,4 @@ tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWith +M.n; +objA.a, M.n; ~~~~~~~ -!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithStringType.errors.txt b/tests/baselines/reference/plusOperatorWithStringType.errors.txt index 979da03c1bd..b731484555a 100644 --- a/tests/baselines/reference/plusOperatorWithStringType.errors.txt +++ b/tests/baselines/reference/plusOperatorWithStringType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithStringType.ts(40,1): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -43,4 +43,4 @@ tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWith +foo(); +objA.a,M.n; ~~~~~~~ -!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file +!!! error TS2695: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFor.errors.txt b/tests/baselines/reference/sourceMapValidationFor.errors.txt index d665ff8ec93..c64544c4b6c 100644 --- a/tests/baselines/reference/sourceMapValidationFor.errors.txt +++ b/tests/baselines/reference/sourceMapValidationFor.errors.txt @@ -1,7 +1,7 @@ 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 TS2693: Left side of comma operator is unused and has no side effects. +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 (4 errors) ==== @@ -44,5 +44,5 @@ tests/cases/compiler/sourceMapValidationFor.ts(32,21): error TS2693: Left side o } for (i = 0, j = 20; j < 20, i < 20; j++) { ~~~~~~ -!!! error TS2693: 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. } \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt b/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt index 6e06101ec77..a16be702955 100644 --- a/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt +++ b/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt @@ -2,8 +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 TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(14,11): error TS2693: 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(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"'. @@ -35,9 +35,9 @@ tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(23 ~~~~~~~~~~~~~~~ !!! error TS2678: Type '"baz"' is not comparable to type '"foo"'. ~ -!!! error TS2693: 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 TS2693: 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; diff --git a/tests/baselines/reference/stringLiteralsWithSwitchStatements04.errors.txt b/tests/baselines/reference/stringLiteralsWithSwitchStatements04.errors.txt index c8626674f89..441978c2fe8 100644 --- a/tests/baselines/reference/stringLiteralsWithSwitchStatements04.errors.txt +++ b/tests/baselines/reference/stringLiteralsWithSwitchStatements04.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(7,10): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(9,10): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(11,10): error TS2693: Left side of comma operator is unused and has no side effects. +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 TS2693: Left side of comma operator is unused and has no side effects. +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 (5 errors) ==== @@ -14,21 +14,21 @@ tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(13 switch (y) { case "foo", x: ~~~~~ -!!! error TS2693: 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. break; case x, "foo": ~ -!!! error TS2693: 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. break; case x, "baz": ~ -!!! error TS2693: 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 TS2678: Type '"baz"' is not comparable to type '"foo" | "bar"'. break; case "baz", x: ~~~~~ -!!! error TS2693: 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. break; case "baz" && "bar": break; diff --git a/tests/baselines/reference/systemModule16.errors.txt b/tests/baselines/reference/systemModule16.errors.txt index e9ed4f3ab86..33d7ba58bc2 100644 --- a/tests/baselines/reference/systemModule16.errors.txt +++ b/tests/baselines/reference/systemModule16.errors.txt @@ -4,10 +4,10 @@ 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 TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/systemModule16.ts(11,1): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/systemModule16.ts(11,1): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/compiler/systemModule16.ts(11,1): error TS2693: 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(11,1): error TS2695: Left side of comma operator is unused and has no side effects. ==== tests/cases/compiler/systemModule16.ts (10 errors) ==== @@ -35,11 +35,11 @@ tests/cases/compiler/systemModule16.ts(11,1): error TS2693: Left side of comma o x,y,a1,b1,d1; ~ -!!! error TS2693: 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 TS2693: 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 TS2693: 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 TS2693: 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. \ No newline at end of file diff --git a/tests/baselines/reference/tsxEmit3.errors.txt b/tests/baselines/reference/tsxEmit3.errors.txt index 1fe8a566f81..bef4d8d4efc 100644 --- a/tests/baselines/reference/tsxEmit3.errors.txt +++ b/tests/baselines/reference/tsxEmit3.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/jsx/file.tsx(19,2): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/jsx/file.tsx(23,3): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/jsx/file.tsx(26,3): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/jsx/file.tsx(39,2): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -25,18 +25,18 @@ tests/cases/conformance/jsx/file.tsx(39,2): error TS2693: Left side of comma ope // Emit M.Foo Foo, ; ~~~ -!!! error TS2693: 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. export module S { // Emit M.Foo Foo, ; ~~~ -!!! error TS2693: 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. // Emit S.Bar Bar, ; ~~~ -!!! error TS2693: 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. } } @@ -51,6 +51,6 @@ tests/cases/conformance/jsx/file.tsx(39,2): error TS2693: Left side of comma ope // Emit M_1.Foo Foo, ; ~~~ -!!! error TS2693: 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. } \ No newline at end of file diff --git a/tests/baselines/reference/tsxErrorRecovery2.errors.txt b/tests/baselines/reference/tsxErrorRecovery2.errors.txt index 9a0b5790b2c..472b94654aa 100644 --- a/tests/baselines/reference/tsxErrorRecovery2.errors.txt +++ b/tests/baselines/reference/tsxErrorRecovery2.errors.txt @@ -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 { } }
+ ~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects.
!!! 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 =
+ ~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. !!! error TS2657: JSX expressions must have one parent element \ No newline at end of file diff --git a/tests/baselines/reference/tsxErrorRecovery3.errors.txt b/tests/baselines/reference/tsxErrorRecovery3.errors.txt index f7e4bc170a9..5e7c5bffcb5 100644 --- a/tests/baselines/reference/tsxErrorRecovery3.errors.txt +++ b/tests/baselines/reference/tsxErrorRecovery3.errors.txt @@ -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 { } }
+ ~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~~~ !!! error TS2304: Cannot find name 'React'.
@@ -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 =
+ ~~~~~~~~~~~ +!!! error TS2695: Left side of comma operator is unused and has no side effects. ~~~ !!! error TS2304: Cannot find name 'React'. ~~~ diff --git a/tests/baselines/reference/typecheckCommaExpression.errors.txt b/tests/baselines/reference/typecheckCommaExpression.errors.txt index 349236d12d7..35628050c60 100644 --- a/tests/baselines/reference/typecheckCommaExpression.errors.txt +++ b/tests/baselines/reference/typecheckCommaExpression.errors.txt @@ -1,5 +1,5 @@ tests/cases/compiler/typecheckCommaExpression.ts(1,2): error TS2304: Cannot find name 'a'. -tests/cases/compiler/typecheckCommaExpression.ts(1,2): error TS2693: Left side of comma operator is unused and has no side effects. +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'. @@ -8,6 +8,6 @@ tests/cases/compiler/typecheckCommaExpression.ts(1,5): error TS2304: Cannot find ~ !!! error TS2304: Cannot find name 'a'. ~ -!!! error TS2693: 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 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt index c11047330c4..94bca545609 100644 --- a/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt @@ -1,7 +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 TS2693: Left side of comma operator is unused and has no side effects. +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. @@ -77,7 +77,7 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator typeof ANY2[0]; typeof ANY, ANY1; ~~~~~~~~~~ -!!! error TS2693: 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. typeof obj1; typeof obj1.x; typeof objA.a; diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt b/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt index b6e33e440f1..48c75a32e9a 100644 --- a/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts(37,1): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -40,7 +40,7 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator typeof foo(); typeof true, false; ~~~~~~~~~~~ -!!! error TS2693: 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. typeof objA.a; typeof M.n; diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt b/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt index c7291544b1e..f078b9ed5b0 100644 --- a/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts(23,1): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -26,7 +26,7 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator typeof ENUM1["B"]; typeof ENUM, ENUM1; ~~~~~~~~~~~ -!!! error TS2693: 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. // use typeof in type query enum z { }; diff --git a/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt b/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt index e5604e1efd8..e9cb922ed0b 100644 --- a/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts(45,1): error TS2693: Left side of comma operator is unused and has no side effects. +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) ==== @@ -48,7 +48,7 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator typeof M.n; typeof objA.a, M.n; ~~~~~~~~~~~~~ -!!! error TS2693: 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. // use typeof in type query var z: number; diff --git a/tests/baselines/reference/typeofOperatorWithStringType.errors.txt b/tests/baselines/reference/typeofOperatorWithStringType.errors.txt index 867703e47c3..6d01d397ab6 100644 --- a/tests/baselines/reference/typeofOperatorWithStringType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithStringType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(44,1): error TS2693: Left side of comma operator is unused and has no side effects. +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. @@ -54,7 +54,7 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator typeof foo(); typeof objA.a, M.n; ~~~~~~~~~~~~~ -!!! error TS2693: 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. // use typeof in type query var z: string; diff --git a/tests/baselines/reference/widenedTypes.errors.txt b/tests/baselines/reference/widenedTypes.errors.txt index e4bc3e70dff..ea7c2b2f92a 100644 --- a/tests/baselines/reference/widenedTypes.errors.txt +++ b/tests/baselines/reference/widenedTypes.errors.txt @@ -2,7 +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 TS2693: Left side of comma operator is unused and has no side effects. +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[]'. @@ -32,7 +32,7 @@ tests/cases/compiler/widenedTypes.ts(24,5): error TS2322: Type '{ x: number; y: var t = [3, (3, null)]; ~ -!!! error TS2693: 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. t[3] = ""; ~~~~ !!! error TS2322: Type '""' is not assignable to type 'number'. diff --git a/tests/baselines/reference/witness.errors.txt b/tests/baselines/reference/witness.errors.txt index 420298f5e45..55f35b65039 100644 --- a/tests/baselines/reference/witness.errors.txt +++ b/tests/baselines/reference/witness.errors.txt @@ -1,11 +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 TS2693: Left side of comma operator is unused and has no side effects. +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 TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/types/witness/witness.ts(34,12): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/types/witness/witness.ts(36,12): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/types/witness/witness.ts(36,12): error TS2693: Left side of comma operator is unused and has no side effects. -tests/cases/conformance/types/witness/witness.ts(36,12): error TS2693: 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(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'. @@ -50,23 +50,23 @@ tests/cases/conformance/types/witness/witness.ts(114,5): error TS2403: Subsequen // Comma var co1 = (co1, 3); ~~~ -!!! error TS2693: 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 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 TS2693: 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 TS2693: 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 TS2693: 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 TS2693: 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 TS2693: 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'.