mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Disallow left comma operator operands which don't have side effects
This commit is contained in:
+24
-39
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
@@ -1,9 +1,10 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(46,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
|
||||
tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(47,26): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'.
|
||||
tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(48,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
|
||||
tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(47,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
|
||||
tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(48,26): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'.
|
||||
tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts(49,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithAnyOtherType.ts (3 errors) ====
|
||||
|
||||
// ~ operator on any type
|
||||
|
||||
var ANY: any;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [bitwiseNotOperatorWithAnyOtherType.ts]
|
||||
|
||||
// ~ operator on any type
|
||||
|
||||
var ANY: any;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [bitwiseNotOperatorWithBooleanType.ts]
|
||||
|
||||
// ~ operator on boolean type
|
||||
var BOOLEAN: boolean;
|
||||
|
||||
|
||||
@@ -1,89 +1,90 @@
|
||||
=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithBooleanType.ts ===
|
||||
|
||||
// ~ operator on boolean type
|
||||
var BOOLEAN: boolean;
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 3))
|
||||
|
||||
function foo(): boolean { return true; }
|
||||
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 21))
|
||||
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 21))
|
||||
|
||||
class A {
|
||||
>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 3, 40))
|
||||
>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 4, 40))
|
||||
|
||||
public a: boolean;
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9))
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 9))
|
||||
|
||||
static foo() { return false; }
|
||||
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 22))
|
||||
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 7, 22))
|
||||
}
|
||||
module M {
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 8, 1))
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 9, 1))
|
||||
|
||||
export var n: boolean;
|
||||
>n : Symbol(n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14))
|
||||
>n : Symbol(n, Decl(bitwiseNotOperatorWithBooleanType.ts, 11, 14))
|
||||
}
|
||||
|
||||
var objA = new A();
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 13, 3))
|
||||
>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 3, 40))
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 14, 3))
|
||||
>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 4, 40))
|
||||
|
||||
// boolean type var
|
||||
var ResultIsNumber1 = ~BOOLEAN;
|
||||
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithBooleanType.ts, 16, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3))
|
||||
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithBooleanType.ts, 17, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 3))
|
||||
|
||||
// boolean type literal
|
||||
var ResultIsNumber2 = ~true;
|
||||
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithBooleanType.ts, 19, 3))
|
||||
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithBooleanType.ts, 20, 3))
|
||||
|
||||
var ResultIsNumber3 = ~{ x: true, y: false };
|
||||
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithBooleanType.ts, 20, 3))
|
||||
>x : Symbol(x, Decl(bitwiseNotOperatorWithBooleanType.ts, 20, 24))
|
||||
>y : Symbol(y, Decl(bitwiseNotOperatorWithBooleanType.ts, 20, 33))
|
||||
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithBooleanType.ts, 21, 3))
|
||||
>x : Symbol(x, Decl(bitwiseNotOperatorWithBooleanType.ts, 21, 24))
|
||||
>y : Symbol(y, Decl(bitwiseNotOperatorWithBooleanType.ts, 21, 33))
|
||||
|
||||
// boolean type expressions
|
||||
var ResultIsNumber4 = ~objA.a;
|
||||
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithBooleanType.ts, 23, 3))
|
||||
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9))
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 13, 3))
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9))
|
||||
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithBooleanType.ts, 24, 3))
|
||||
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 9))
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 14, 3))
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 9))
|
||||
|
||||
var ResultIsNumber5 = ~M.n;
|
||||
>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithBooleanType.ts, 24, 3))
|
||||
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14))
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 8, 1))
|
||||
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14))
|
||||
>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithBooleanType.ts, 25, 3))
|
||||
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 11, 14))
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 9, 1))
|
||||
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 11, 14))
|
||||
|
||||
var ResultIsNumber6 = ~foo();
|
||||
>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithBooleanType.ts, 25, 3))
|
||||
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 21))
|
||||
>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithBooleanType.ts, 26, 3))
|
||||
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 21))
|
||||
|
||||
var ResultIsNumber7 = ~A.foo();
|
||||
>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithBooleanType.ts, 26, 3))
|
||||
>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 22))
|
||||
>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 3, 40))
|
||||
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 22))
|
||||
>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithBooleanType.ts, 27, 3))
|
||||
>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 7, 22))
|
||||
>A : Symbol(A, Decl(bitwiseNotOperatorWithBooleanType.ts, 4, 40))
|
||||
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 7, 22))
|
||||
|
||||
// multiple ~ operators
|
||||
var ResultIsNumber8 = ~~BOOLEAN;
|
||||
>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithBooleanType.ts, 29, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3))
|
||||
>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithBooleanType.ts, 30, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 3))
|
||||
|
||||
// miss assignment operators
|
||||
~true;
|
||||
~BOOLEAN;
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 3))
|
||||
|
||||
~foo();
|
||||
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 1, 21))
|
||||
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithBooleanType.ts, 2, 21))
|
||||
|
||||
~true, false;
|
||||
~objA.a;
|
||||
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9))
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 13, 3))
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 5, 9))
|
||||
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 9))
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithBooleanType.ts, 14, 3))
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithBooleanType.ts, 6, 9))
|
||||
|
||||
~M.n;
|
||||
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14))
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 8, 1))
|
||||
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 10, 14))
|
||||
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 11, 14))
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithBooleanType.ts, 9, 1))
|
||||
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithBooleanType.ts, 11, 14))
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithBooleanType.ts ===
|
||||
|
||||
// ~ operator on boolean type
|
||||
var BOOLEAN: boolean;
|
||||
>BOOLEAN : boolean
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [bitwiseNotOperatorWithEnumType.ts]
|
||||
|
||||
// ~ operator on enum type
|
||||
|
||||
enum ENUM1 { A, B, "" };
|
||||
|
||||
@@ -1,38 +1,39 @@
|
||||
=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithEnumType.ts ===
|
||||
|
||||
// ~ operator on enum type
|
||||
|
||||
enum ENUM1 { A, B, "" };
|
||||
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
|
||||
>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12))
|
||||
>B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15))
|
||||
>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12))
|
||||
>B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 15))
|
||||
|
||||
// enum type var
|
||||
var ResultIsNumber1 = ~ENUM1;
|
||||
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithEnumType.ts, 5, 3))
|
||||
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithEnumType.ts, 6, 3))
|
||||
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
|
||||
|
||||
// enum type expressions
|
||||
var ResultIsNumber2 = ~ENUM1["A"];
|
||||
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithEnumType.ts, 8, 3))
|
||||
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithEnumType.ts, 9, 3))
|
||||
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
|
||||
>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12))
|
||||
>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12))
|
||||
|
||||
var ResultIsNumber3 = ~(ENUM1.A + ENUM1["B"]);
|
||||
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithEnumType.ts, 9, 3))
|
||||
>ENUM1.A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12))
|
||||
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithEnumType.ts, 10, 3))
|
||||
>ENUM1.A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12))
|
||||
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
|
||||
>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12))
|
||||
>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12))
|
||||
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
|
||||
>"B" : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15))
|
||||
>"B" : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 15))
|
||||
|
||||
// multiple ~ operators
|
||||
var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B);
|
||||
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithEnumType.ts, 12, 3))
|
||||
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithEnumType.ts, 13, 3))
|
||||
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
|
||||
>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12))
|
||||
>ENUM1.B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15))
|
||||
>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12))
|
||||
>ENUM1.B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 15))
|
||||
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
|
||||
>B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15))
|
||||
>B : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 15))
|
||||
|
||||
// miss assignment operators
|
||||
~ENUM1;
|
||||
@@ -40,12 +41,12 @@ var ResultIsNumber4 = ~~~(ENUM1["A"] + ENUM1.B);
|
||||
|
||||
~ENUM1["A"];
|
||||
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
|
||||
>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12))
|
||||
>"A" : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12))
|
||||
|
||||
~ENUM1.A, ~ENUM1["B"];
|
||||
>ENUM1.A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12))
|
||||
>ENUM1.A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12))
|
||||
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
|
||||
>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 12))
|
||||
>A : Symbol(ENUM1.A, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 12))
|
||||
>ENUM1 : Symbol(ENUM1, Decl(bitwiseNotOperatorWithEnumType.ts, 0, 0))
|
||||
>"B" : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 2, 15))
|
||||
>"B" : Symbol(ENUM1.B, Decl(bitwiseNotOperatorWithEnumType.ts, 3, 15))
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithEnumType.ts ===
|
||||
|
||||
// ~ operator on enum type
|
||||
|
||||
enum ENUM1 { A, B, "" };
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [bitwiseNotOperatorWithNumberType.ts]
|
||||
|
||||
// ~ operator on number type
|
||||
var NUMBER: number;
|
||||
var NUMBER1: number[] = [1, 2];
|
||||
|
||||
@@ -1,126 +1,127 @@
|
||||
=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithNumberType.ts ===
|
||||
|
||||
// ~ operator on number type
|
||||
var NUMBER: number;
|
||||
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
|
||||
|
||||
var NUMBER1: number[] = [1, 2];
|
||||
>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
|
||||
>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 3))
|
||||
|
||||
function foo(): number { return 1; }
|
||||
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 31))
|
||||
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 31))
|
||||
|
||||
class A {
|
||||
>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 4, 36))
|
||||
>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 5, 36))
|
||||
|
||||
public a: number;
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9))
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9))
|
||||
|
||||
static foo() { return 1; }
|
||||
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 21))
|
||||
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 8, 21))
|
||||
}
|
||||
module M {
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1))
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 10, 1))
|
||||
|
||||
export var n: number;
|
||||
>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14))
|
||||
>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14))
|
||||
}
|
||||
|
||||
var objA = new A();
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3))
|
||||
>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 4, 36))
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 15, 3))
|
||||
>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 5, 36))
|
||||
|
||||
// number type var
|
||||
var ResultIsNumber1 = ~NUMBER;
|
||||
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithNumberType.ts, 17, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3))
|
||||
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithNumberType.ts, 18, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
|
||||
|
||||
var ResultIsNumber2 = ~NUMBER1;
|
||||
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithNumberType.ts, 18, 3))
|
||||
>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
|
||||
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithNumberType.ts, 19, 3))
|
||||
>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 3))
|
||||
|
||||
// number type literal
|
||||
var ResultIsNumber3 = ~1;
|
||||
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithNumberType.ts, 21, 3))
|
||||
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithNumberType.ts, 22, 3))
|
||||
|
||||
var ResultIsNumber4 = ~{ x: 1, y: 2};
|
||||
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithNumberType.ts, 22, 3))
|
||||
>x : Symbol(x, Decl(bitwiseNotOperatorWithNumberType.ts, 22, 24))
|
||||
>y : Symbol(y, Decl(bitwiseNotOperatorWithNumberType.ts, 22, 30))
|
||||
|
||||
var ResultIsNumber5 = ~{ x: 1, y: (n: number) => { return n; } };
|
||||
>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 3))
|
||||
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 3))
|
||||
>x : Symbol(x, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 24))
|
||||
>y : Symbol(y, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 30))
|
||||
>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 35))
|
||||
>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 23, 35))
|
||||
|
||||
var ResultIsNumber5 = ~{ x: 1, y: (n: number) => { return n; } };
|
||||
>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithNumberType.ts, 24, 3))
|
||||
>x : Symbol(x, Decl(bitwiseNotOperatorWithNumberType.ts, 24, 24))
|
||||
>y : Symbol(y, Decl(bitwiseNotOperatorWithNumberType.ts, 24, 30))
|
||||
>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 24, 35))
|
||||
>n : Symbol(n, Decl(bitwiseNotOperatorWithNumberType.ts, 24, 35))
|
||||
|
||||
// number type expressions
|
||||
var ResultIsNumber6 = ~objA.a;
|
||||
>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithNumberType.ts, 26, 3))
|
||||
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9))
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3))
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9))
|
||||
>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithNumberType.ts, 27, 3))
|
||||
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9))
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 15, 3))
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9))
|
||||
|
||||
var ResultIsNumber7 = ~M.n;
|
||||
>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithNumberType.ts, 27, 3))
|
||||
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14))
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1))
|
||||
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14))
|
||||
>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithNumberType.ts, 28, 3))
|
||||
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14))
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 10, 1))
|
||||
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14))
|
||||
|
||||
var ResultIsNumber8 = ~NUMBER1[0];
|
||||
>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithNumberType.ts, 28, 3))
|
||||
>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
|
||||
>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithNumberType.ts, 29, 3))
|
||||
>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 3))
|
||||
|
||||
var ResultIsNumber9 = ~foo();
|
||||
>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(bitwiseNotOperatorWithNumberType.ts, 29, 3))
|
||||
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 31))
|
||||
>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(bitwiseNotOperatorWithNumberType.ts, 30, 3))
|
||||
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 31))
|
||||
|
||||
var ResultIsNumber10 = ~A.foo();
|
||||
>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(bitwiseNotOperatorWithNumberType.ts, 30, 3))
|
||||
>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 21))
|
||||
>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 4, 36))
|
||||
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 21))
|
||||
>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(bitwiseNotOperatorWithNumberType.ts, 31, 3))
|
||||
>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 8, 21))
|
||||
>A : Symbol(A, Decl(bitwiseNotOperatorWithNumberType.ts, 5, 36))
|
||||
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithNumberType.ts, 8, 21))
|
||||
|
||||
var ResultIsNumber11 = ~(NUMBER + NUMBER);
|
||||
>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(bitwiseNotOperatorWithNumberType.ts, 31, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3))
|
||||
>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(bitwiseNotOperatorWithNumberType.ts, 32, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
|
||||
|
||||
// multiple ~ operators
|
||||
var ResultIsNumber12 = ~~NUMBER;
|
||||
>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(bitwiseNotOperatorWithNumberType.ts, 34, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3))
|
||||
>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(bitwiseNotOperatorWithNumberType.ts, 35, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
|
||||
|
||||
var ResultIsNumber13 = ~~~(NUMBER + NUMBER);
|
||||
>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(bitwiseNotOperatorWithNumberType.ts, 35, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3))
|
||||
>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(bitwiseNotOperatorWithNumberType.ts, 36, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
|
||||
|
||||
// miss assignment operators
|
||||
~NUMBER;
|
||||
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 1, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
|
||||
|
||||
~NUMBER1;
|
||||
>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 3))
|
||||
>NUMBER1 : Symbol(NUMBER1, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 3))
|
||||
|
||||
~foo();
|
||||
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 2, 31))
|
||||
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithNumberType.ts, 3, 31))
|
||||
|
||||
~objA.a;
|
||||
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9))
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3))
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9))
|
||||
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9))
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 15, 3))
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9))
|
||||
|
||||
~M.n;
|
||||
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14))
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1))
|
||||
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14))
|
||||
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14))
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 10, 1))
|
||||
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14))
|
||||
|
||||
~objA.a, M.n;
|
||||
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9))
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 14, 3))
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 6, 9))
|
||||
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14))
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 9, 1))
|
||||
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 11, 14))
|
||||
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9))
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithNumberType.ts, 15, 3))
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithNumberType.ts, 7, 9))
|
||||
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14))
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithNumberType.ts, 10, 1))
|
||||
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithNumberType.ts, 12, 14))
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithNumberType.ts ===
|
||||
|
||||
// ~ operator on number type
|
||||
var NUMBER: number;
|
||||
>NUMBER : number
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [bitwiseNotOperatorWithStringType.ts]
|
||||
|
||||
// ~ operator on string type
|
||||
var STRING: string;
|
||||
var STRING1: string[] = ["", "abc"];
|
||||
|
||||
@@ -1,122 +1,123 @@
|
||||
=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithStringType.ts ===
|
||||
|
||||
// ~ operator on string type
|
||||
var STRING: string;
|
||||
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
|
||||
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
|
||||
|
||||
var STRING1: string[] = ["", "abc"];
|
||||
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
|
||||
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 3, 3))
|
||||
|
||||
function foo(): string { return "abc"; }
|
||||
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 2, 36))
|
||||
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 3, 36))
|
||||
|
||||
class A {
|
||||
>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 4, 40))
|
||||
>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 5, 40))
|
||||
|
||||
public a: string;
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9))
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 7, 9))
|
||||
|
||||
static foo() { return ""; }
|
||||
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 7, 21))
|
||||
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 8, 21))
|
||||
}
|
||||
module M {
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 9, 1))
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 10, 1))
|
||||
|
||||
export var n: string;
|
||||
>n : Symbol(n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14))
|
||||
>n : Symbol(n, Decl(bitwiseNotOperatorWithStringType.ts, 12, 14))
|
||||
}
|
||||
|
||||
var objA = new A();
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 14, 3))
|
||||
>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 4, 40))
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 15, 3))
|
||||
>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 5, 40))
|
||||
|
||||
// string type var
|
||||
var ResultIsNumber1 = ~STRING;
|
||||
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithStringType.ts, 17, 3))
|
||||
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
|
||||
>ResultIsNumber1 : Symbol(ResultIsNumber1, Decl(bitwiseNotOperatorWithStringType.ts, 18, 3))
|
||||
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
|
||||
|
||||
var ResultIsNumber2 = ~STRING1;
|
||||
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithStringType.ts, 18, 3))
|
||||
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
|
||||
>ResultIsNumber2 : Symbol(ResultIsNumber2, Decl(bitwiseNotOperatorWithStringType.ts, 19, 3))
|
||||
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 3, 3))
|
||||
|
||||
// string type literal
|
||||
var ResultIsNumber3 = ~"";
|
||||
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithStringType.ts, 21, 3))
|
||||
>ResultIsNumber3 : Symbol(ResultIsNumber3, Decl(bitwiseNotOperatorWithStringType.ts, 22, 3))
|
||||
|
||||
var ResultIsNumber4 = ~{ x: "", y: "" };
|
||||
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithStringType.ts, 22, 3))
|
||||
>x : Symbol(x, Decl(bitwiseNotOperatorWithStringType.ts, 22, 24))
|
||||
>y : Symbol(y, Decl(bitwiseNotOperatorWithStringType.ts, 22, 31))
|
||||
|
||||
var ResultIsNumber5 = ~{ x: "", y: (s: string) => { return s; } };
|
||||
>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithStringType.ts, 23, 3))
|
||||
>ResultIsNumber4 : Symbol(ResultIsNumber4, Decl(bitwiseNotOperatorWithStringType.ts, 23, 3))
|
||||
>x : Symbol(x, Decl(bitwiseNotOperatorWithStringType.ts, 23, 24))
|
||||
>y : Symbol(y, Decl(bitwiseNotOperatorWithStringType.ts, 23, 31))
|
||||
>s : Symbol(s, Decl(bitwiseNotOperatorWithStringType.ts, 23, 36))
|
||||
>s : Symbol(s, Decl(bitwiseNotOperatorWithStringType.ts, 23, 36))
|
||||
|
||||
var ResultIsNumber5 = ~{ x: "", y: (s: string) => { return s; } };
|
||||
>ResultIsNumber5 : Symbol(ResultIsNumber5, Decl(bitwiseNotOperatorWithStringType.ts, 24, 3))
|
||||
>x : Symbol(x, Decl(bitwiseNotOperatorWithStringType.ts, 24, 24))
|
||||
>y : Symbol(y, Decl(bitwiseNotOperatorWithStringType.ts, 24, 31))
|
||||
>s : Symbol(s, Decl(bitwiseNotOperatorWithStringType.ts, 24, 36))
|
||||
>s : Symbol(s, Decl(bitwiseNotOperatorWithStringType.ts, 24, 36))
|
||||
|
||||
// string type expressions
|
||||
var ResultIsNumber6 = ~objA.a;
|
||||
>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithStringType.ts, 26, 3))
|
||||
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9))
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 14, 3))
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9))
|
||||
>ResultIsNumber6 : Symbol(ResultIsNumber6, Decl(bitwiseNotOperatorWithStringType.ts, 27, 3))
|
||||
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 7, 9))
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 15, 3))
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 7, 9))
|
||||
|
||||
var ResultIsNumber7 = ~M.n;
|
||||
>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithStringType.ts, 27, 3))
|
||||
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14))
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 9, 1))
|
||||
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14))
|
||||
>ResultIsNumber7 : Symbol(ResultIsNumber7, Decl(bitwiseNotOperatorWithStringType.ts, 28, 3))
|
||||
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 12, 14))
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 10, 1))
|
||||
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 12, 14))
|
||||
|
||||
var ResultIsNumber8 = ~STRING1[0];
|
||||
>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithStringType.ts, 28, 3))
|
||||
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
|
||||
>ResultIsNumber8 : Symbol(ResultIsNumber8, Decl(bitwiseNotOperatorWithStringType.ts, 29, 3))
|
||||
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 3, 3))
|
||||
|
||||
var ResultIsNumber9 = ~foo();
|
||||
>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(bitwiseNotOperatorWithStringType.ts, 29, 3))
|
||||
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 2, 36))
|
||||
>ResultIsNumber9 : Symbol(ResultIsNumber9, Decl(bitwiseNotOperatorWithStringType.ts, 30, 3))
|
||||
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 3, 36))
|
||||
|
||||
var ResultIsNumber10 = ~A.foo();
|
||||
>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(bitwiseNotOperatorWithStringType.ts, 30, 3))
|
||||
>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 7, 21))
|
||||
>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 4, 40))
|
||||
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 7, 21))
|
||||
>ResultIsNumber10 : Symbol(ResultIsNumber10, Decl(bitwiseNotOperatorWithStringType.ts, 31, 3))
|
||||
>A.foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 8, 21))
|
||||
>A : Symbol(A, Decl(bitwiseNotOperatorWithStringType.ts, 5, 40))
|
||||
>foo : Symbol(A.foo, Decl(bitwiseNotOperatorWithStringType.ts, 8, 21))
|
||||
|
||||
var ResultIsNumber11 = ~(STRING + STRING);
|
||||
>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(bitwiseNotOperatorWithStringType.ts, 31, 3))
|
||||
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
|
||||
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
|
||||
>ResultIsNumber11 : Symbol(ResultIsNumber11, Decl(bitwiseNotOperatorWithStringType.ts, 32, 3))
|
||||
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
|
||||
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
|
||||
|
||||
var ResultIsNumber12 = ~STRING.charAt(0);
|
||||
>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(bitwiseNotOperatorWithStringType.ts, 32, 3))
|
||||
>ResultIsNumber12 : Symbol(ResultIsNumber12, Decl(bitwiseNotOperatorWithStringType.ts, 33, 3))
|
||||
>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --))
|
||||
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
|
||||
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
|
||||
>charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --))
|
||||
|
||||
// multiple ~ operators
|
||||
var ResultIsNumber13 = ~~STRING;
|
||||
>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(bitwiseNotOperatorWithStringType.ts, 35, 3))
|
||||
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
|
||||
>ResultIsNumber13 : Symbol(ResultIsNumber13, Decl(bitwiseNotOperatorWithStringType.ts, 36, 3))
|
||||
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
|
||||
|
||||
var ResultIsNumber14 = ~~~(STRING + STRING);
|
||||
>ResultIsNumber14 : Symbol(ResultIsNumber14, Decl(bitwiseNotOperatorWithStringType.ts, 36, 3))
|
||||
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
|
||||
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
|
||||
>ResultIsNumber14 : Symbol(ResultIsNumber14, Decl(bitwiseNotOperatorWithStringType.ts, 37, 3))
|
||||
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
|
||||
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
|
||||
|
||||
//miss assignment operators
|
||||
~STRING;
|
||||
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 1, 3))
|
||||
>STRING : Symbol(STRING, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
|
||||
|
||||
~STRING1;
|
||||
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 2, 3))
|
||||
>STRING1 : Symbol(STRING1, Decl(bitwiseNotOperatorWithStringType.ts, 3, 3))
|
||||
|
||||
~foo();
|
||||
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 2, 36))
|
||||
>foo : Symbol(foo, Decl(bitwiseNotOperatorWithStringType.ts, 3, 36))
|
||||
|
||||
~objA.a,M.n;
|
||||
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9))
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 14, 3))
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 6, 9))
|
||||
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14))
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 9, 1))
|
||||
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 11, 14))
|
||||
>objA.a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 7, 9))
|
||||
>objA : Symbol(objA, Decl(bitwiseNotOperatorWithStringType.ts, 15, 3))
|
||||
>a : Symbol(A.a, Decl(bitwiseNotOperatorWithStringType.ts, 7, 9))
|
||||
>M.n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 12, 14))
|
||||
>M : Symbol(M, Decl(bitwiseNotOperatorWithStringType.ts, 10, 1))
|
||||
>n : Symbol(M.n, Decl(bitwiseNotOperatorWithStringType.ts, 12, 14))
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/expressions/unaryOperators/bitwiseNotOperator/bitwiseNotOperatorWithStringType.ts ===
|
||||
|
||||
// ~ operator on string type
|
||||
var STRING: string;
|
||||
>STRING : string
|
||||
|
||||
@@ -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.
|
||||
}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(10,1): error TS2322: Type 'string' is not assignable to type 'boolean'.
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(11,1): error TS2322: Type 'number' is not assignable to type 'boolean'.
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(13,1): error TS2322: Type 'boolean' is not assignable to type 'number'.
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(14,1): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(16,1): error TS2322: Type 'boolean' is not assignable to type 'string'.
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(17,1): error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(11,1): error TS2322: Type 'string' is not assignable to type 'boolean'.
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(12,1): error TS2322: Type 'number' is not assignable to type 'boolean'.
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(14,1): error TS2322: Type 'boolean' is not assignable to type 'number'.
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(15,1): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(17,1): error TS2322: Type 'boolean' is not assignable to type 'string'.
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts(18,1): error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/commaOperator/commaOperatorInvalidAssignmentType.ts (6 errors) ====
|
||||
|
||||
var BOOLEAN: boolean;
|
||||
var NUMBER: number;
|
||||
var STRING: string;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [commaOperatorInvalidAssignmentType.ts]
|
||||
|
||||
var BOOLEAN: boolean;
|
||||
var NUMBER: number;
|
||||
var STRING: string;
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
tests/cases/compiler/commaOperatorLeftSideUnused.ts(8,10): error 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);
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
//// [commaOperatorLeftSideUnused.ts]
|
||||
var xx: any;
|
||||
var yy: any;
|
||||
|
||||
function fn() {
|
||||
let arr: any[] = [];
|
||||
switch(arr.length) {
|
||||
// Should error
|
||||
case 0, 1:
|
||||
return 'zero or one';
|
||||
default:
|
||||
return 'more than one';
|
||||
}
|
||||
}
|
||||
|
||||
// Should error
|
||||
let x = Math.pow((3, 5), 2);
|
||||
|
||||
// Should error
|
||||
let a = [(3 + 4), ((1 + 1, 8) * 4)];
|
||||
|
||||
// Error cases
|
||||
xx = (1, 2);
|
||||
xx = ('', xx);
|
||||
xx = (/323/, 5);
|
||||
xx = (`wat`, 'ok'),
|
||||
xx = (true, false);
|
||||
xx = (false, true);
|
||||
xx = (null, xx);
|
||||
xx = (undefined, 10);
|
||||
xx = (() => {}, 'no');
|
||||
xx = (function() { }, 100);
|
||||
xx = ({}, {});
|
||||
xx = (typeof xx, 'unused');
|
||||
xx = ([1, 2, x++], xx);
|
||||
xx = (xx!, xx);
|
||||
xx = (xx ? 3 : 4, 10);
|
||||
xx = (3 + 4, 10);
|
||||
xx = (!xx, 10);
|
||||
xx = (~xx, 10);
|
||||
xx = (-xx, 10);
|
||||
xx = (+xx, 10);
|
||||
|
||||
// OK cases
|
||||
xx = (xx ? x++ : 4, 10);
|
||||
xx = (--xx, 3);
|
||||
xx = (xx = 3, 1);
|
||||
xx = ((xx = 3), 5);
|
||||
xx = (xx+= 4, xx);
|
||||
xx = ((xx+= 4), xx);
|
||||
xx = (Math.pow(3, 2), 4);
|
||||
xx = (void xx, 10);
|
||||
xx = (xx as any, 100);
|
||||
|
||||
|
||||
//// [commaOperatorLeftSideUnused.js]
|
||||
var xx;
|
||||
var yy;
|
||||
function fn() {
|
||||
var arr = [];
|
||||
switch (arr.length) {
|
||||
// Should error
|
||||
case 0, 1:
|
||||
return 'zero or one';
|
||||
default:
|
||||
return 'more than one';
|
||||
}
|
||||
}
|
||||
// Should error
|
||||
var x = Math.pow((3, 5), 2);
|
||||
// Should error
|
||||
var a = [(3 + 4), ((1 + 1, 8) * 4)];
|
||||
// Error cases
|
||||
xx = (1, 2);
|
||||
xx = ('', xx);
|
||||
xx = (/323/, 5);
|
||||
xx = ("wat", 'ok'),
|
||||
xx = (true, false);
|
||||
xx = (false, true);
|
||||
xx = (null, xx);
|
||||
xx = (undefined, 10);
|
||||
xx = (function () { }, 'no');
|
||||
xx = (function () { }, 100);
|
||||
xx = ({}, {});
|
||||
xx = (typeof xx, 'unused');
|
||||
xx = ([1, 2, x++], xx);
|
||||
xx = (xx, xx);
|
||||
xx = (xx ? 3 : 4, 10);
|
||||
xx = (3 + 4, 10);
|
||||
xx = (!xx, 10);
|
||||
xx = (~xx, 10);
|
||||
xx = (-xx, 10);
|
||||
xx = (+xx, 10);
|
||||
// OK cases
|
||||
xx = (xx ? x++ : 4, 10);
|
||||
xx = (--xx, 3);
|
||||
xx = (xx = 3, 1);
|
||||
xx = ((xx = 3), 5);
|
||||
xx = (xx += 4, xx);
|
||||
xx = ((xx += 4), xx);
|
||||
xx = (Math.pow(3, 2), 4);
|
||||
xx = (void xx, 10);
|
||||
xx = (xx, 100);
|
||||
@@ -1,8 +1,9 @@
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(6,5): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(12,9): error TS2322: Type 'T2' is not assignable to type 'T1'.
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(7,5): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts(13,9): error TS2322: Type 'T2' is not assignable to type 'T1'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/commaOperator/commaOperatorOtherInvalidOperation.ts (2 errors) ====
|
||||
|
||||
//Expect to have compiler errors
|
||||
//Comma operator in fuction arguments and return
|
||||
function foo(x: number, y: string) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [commaOperatorOtherInvalidOperation.ts]
|
||||
|
||||
//Expect to have compiler errors
|
||||
//Comma operator in fuction arguments and return
|
||||
function foo(x: number, y: string) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [commaOperatorOtherValidOperation.ts]
|
||||
|
||||
//Comma operator in for loop
|
||||
for (var i = 0, j = 10; i < j; i++, j--)
|
||||
{
|
||||
|
||||
@@ -1,50 +1,51 @@
|
||||
=== tests/cases/conformance/expressions/commaOperator/commaOperatorOtherValidOperation.ts ===
|
||||
|
||||
//Comma operator in for loop
|
||||
for (var i = 0, j = 10; i < j; i++, j--)
|
||||
>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8))
|
||||
>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15))
|
||||
>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8))
|
||||
>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15))
|
||||
>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 1, 8))
|
||||
>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 1, 15))
|
||||
>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 2, 8))
|
||||
>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 2, 15))
|
||||
>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 2, 8))
|
||||
>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 2, 15))
|
||||
>i : Symbol(i, Decl(commaOperatorOtherValidOperation.ts, 2, 8))
|
||||
>j : Symbol(j, Decl(commaOperatorOtherValidOperation.ts, 2, 15))
|
||||
{
|
||||
}
|
||||
|
||||
//Comma operator in fuction arguments and return
|
||||
function foo(x: number, y: string)
|
||||
>foo : Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 3, 1))
|
||||
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 6, 13))
|
||||
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 6, 23))
|
||||
>foo : Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 4, 1))
|
||||
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 7, 13))
|
||||
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 7, 23))
|
||||
{
|
||||
return x, y;
|
||||
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 6, 13))
|
||||
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 6, 23))
|
||||
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 7, 13))
|
||||
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 7, 23))
|
||||
}
|
||||
var resultIsString = foo(1, "123");
|
||||
>resultIsString : Symbol(resultIsString, Decl(commaOperatorOtherValidOperation.ts, 10, 3))
|
||||
>foo : Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 3, 1))
|
||||
>resultIsString : Symbol(resultIsString, Decl(commaOperatorOtherValidOperation.ts, 11, 3))
|
||||
>foo : Symbol(foo, Decl(commaOperatorOtherValidOperation.ts, 4, 1))
|
||||
|
||||
//TypeParameters
|
||||
function foo1<T1, T2>()
|
||||
>foo1 : Symbol(foo1, Decl(commaOperatorOtherValidOperation.ts, 10, 35))
|
||||
>T1 : Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 13, 14))
|
||||
>T2 : Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 13, 17))
|
||||
>foo1 : Symbol(foo1, Decl(commaOperatorOtherValidOperation.ts, 11, 35))
|
||||
>T1 : Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 14, 14))
|
||||
>T2 : Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 14, 17))
|
||||
{
|
||||
var x: T1;
|
||||
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7))
|
||||
>T1 : Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 13, 14))
|
||||
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 16, 7))
|
||||
>T1 : Symbol(T1, Decl(commaOperatorOtherValidOperation.ts, 14, 14))
|
||||
|
||||
var y: T2;
|
||||
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7))
|
||||
>T2 : Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 13, 17))
|
||||
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 17, 7))
|
||||
>T2 : Symbol(T2, Decl(commaOperatorOtherValidOperation.ts, 14, 17))
|
||||
|
||||
x, y;
|
||||
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7))
|
||||
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7))
|
||||
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 16, 7))
|
||||
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 17, 7))
|
||||
|
||||
var resultIsT1 = (y, x);
|
||||
>resultIsT1 : Symbol(resultIsT1, Decl(commaOperatorOtherValidOperation.ts, 18, 7))
|
||||
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 16, 7))
|
||||
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 15, 7))
|
||||
>resultIsT1 : Symbol(resultIsT1, Decl(commaOperatorOtherValidOperation.ts, 19, 7))
|
||||
>y : Symbol(y, Decl(commaOperatorOtherValidOperation.ts, 17, 7))
|
||||
>x : Symbol(x, Decl(commaOperatorOtherValidOperation.ts, 16, 7))
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/expressions/commaOperator/commaOperatorOtherValidOperation.ts ===
|
||||
|
||||
//Comma operator in for loop
|
||||
for (var i = 0, j = 10; i < j; i++, j--)
|
||||
>i : number
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [commaOperatorWithSecondOperandAnyType.ts]
|
||||
|
||||
var ANY: any;
|
||||
var BOOLEAN: boolean;
|
||||
var NUMBER: number;
|
||||
|
||||
@@ -1,77 +1,78 @@
|
||||
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandAnyType.ts ===
|
||||
|
||||
var ANY: any;
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
|
||||
var BOOLEAN: boolean;
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
|
||||
|
||||
var NUMBER: number;
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
|
||||
|
||||
var STRING: string;
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3))
|
||||
|
||||
var OBJECT: Object;
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 5, 3))
|
||||
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
|
||||
//The second operand type is any
|
||||
ANY, ANY;
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
|
||||
BOOLEAN, ANY;
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
|
||||
NUMBER, ANY;
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
|
||||
STRING, ANY;
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
|
||||
OBJECT, ANY;
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 5, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
|
||||
//Return type is any
|
||||
var resultIsAny1 = (ANY, ANY);
|
||||
>resultIsAny1 : Symbol(resultIsAny1, Decl(commaOperatorWithSecondOperandAnyType.ts, 14, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
|
||||
>resultIsAny1 : Symbol(resultIsAny1, Decl(commaOperatorWithSecondOperandAnyType.ts, 15, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
|
||||
var resultIsAny2 = (BOOLEAN, ANY);
|
||||
>resultIsAny2 : Symbol(resultIsAny2, Decl(commaOperatorWithSecondOperandAnyType.ts, 15, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
|
||||
>resultIsAny2 : Symbol(resultIsAny2, Decl(commaOperatorWithSecondOperandAnyType.ts, 16, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
|
||||
var resultIsAny3 = (NUMBER, ANY);
|
||||
>resultIsAny3 : Symbol(resultIsAny3, Decl(commaOperatorWithSecondOperandAnyType.ts, 16, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
|
||||
>resultIsAny3 : Symbol(resultIsAny3, Decl(commaOperatorWithSecondOperandAnyType.ts, 17, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
|
||||
var resultIsAny4 = (STRING, ANY);
|
||||
>resultIsAny4 : Symbol(resultIsAny4, Decl(commaOperatorWithSecondOperandAnyType.ts, 17, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
|
||||
>resultIsAny4 : Symbol(resultIsAny4, Decl(commaOperatorWithSecondOperandAnyType.ts, 18, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
|
||||
var resultIsAny5 = (OBJECT, ANY);
|
||||
>resultIsAny5 : Symbol(resultIsAny5, Decl(commaOperatorWithSecondOperandAnyType.ts, 18, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 4, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
|
||||
>resultIsAny5 : Symbol(resultIsAny5, Decl(commaOperatorWithSecondOperandAnyType.ts, 19, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandAnyType.ts, 5, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
|
||||
//Literal and expression
|
||||
var x: any;
|
||||
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3))
|
||||
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 22, 3))
|
||||
|
||||
1, ANY;
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
|
||||
++NUMBER, ANY;
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
|
||||
"string", [null, 1];
|
||||
"string".charAt(0), [null, 1];
|
||||
@@ -79,36 +80,36 @@ var x: any;
|
||||
>charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --))
|
||||
|
||||
true, x("any");
|
||||
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3))
|
||||
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 22, 3))
|
||||
|
||||
!BOOLEAN, x.doSomeThing();
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
|
||||
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 22, 3))
|
||||
|
||||
var resultIsAny6 = (1, ANY);
|
||||
>resultIsAny6 : Symbol(resultIsAny6, Decl(commaOperatorWithSecondOperandAnyType.ts, 30, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
|
||||
>resultIsAny6 : Symbol(resultIsAny6, Decl(commaOperatorWithSecondOperandAnyType.ts, 31, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
|
||||
var resultIsAny7 = (++NUMBER, ANY);
|
||||
>resultIsAny7 : Symbol(resultIsAny7, Decl(commaOperatorWithSecondOperandAnyType.ts, 31, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 0, 3))
|
||||
>resultIsAny7 : Symbol(resultIsAny7, Decl(commaOperatorWithSecondOperandAnyType.ts, 32, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandAnyType.ts, 3, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
|
||||
var resultIsAny8 = ("string", null);
|
||||
>resultIsAny8 : Symbol(resultIsAny8, Decl(commaOperatorWithSecondOperandAnyType.ts, 32, 3))
|
||||
>resultIsAny8 : Symbol(resultIsAny8, Decl(commaOperatorWithSecondOperandAnyType.ts, 33, 3))
|
||||
|
||||
var resultIsAny9 = ("string".charAt(0), undefined);
|
||||
>resultIsAny9 : Symbol(resultIsAny9, Decl(commaOperatorWithSecondOperandAnyType.ts, 33, 3))
|
||||
>resultIsAny9 : Symbol(resultIsAny9, Decl(commaOperatorWithSecondOperandAnyType.ts, 34, 3))
|
||||
>"string".charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --))
|
||||
>charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --))
|
||||
>undefined : Symbol(undefined)
|
||||
|
||||
var resultIsAny10 = (true, x("any"));
|
||||
>resultIsAny10 : Symbol(resultIsAny10, Decl(commaOperatorWithSecondOperandAnyType.ts, 34, 3))
|
||||
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3))
|
||||
>resultIsAny10 : Symbol(resultIsAny10, Decl(commaOperatorWithSecondOperandAnyType.ts, 35, 3))
|
||||
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 22, 3))
|
||||
|
||||
var resultIsAny11 = (!BOOLEAN, x.doSomeThing());
|
||||
>resultIsAny11 : Symbol(resultIsAny11, Decl(commaOperatorWithSecondOperandAnyType.ts, 35, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 1, 3))
|
||||
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 21, 3))
|
||||
>resultIsAny11 : Symbol(resultIsAny11, Decl(commaOperatorWithSecondOperandAnyType.ts, 36, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandAnyType.ts, 2, 3))
|
||||
>x : Symbol(x, Decl(commaOperatorWithSecondOperandAnyType.ts, 22, 3))
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandAnyType.ts ===
|
||||
|
||||
var ANY: any;
|
||||
>ANY : any
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [commaOperatorWithSecondOperandBooleanType.ts]
|
||||
|
||||
var ANY: any;
|
||||
var BOOLEAN: boolean;
|
||||
var NUMBER: number;
|
||||
|
||||
@@ -1,110 +1,111 @@
|
||||
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandBooleanType.ts ===
|
||||
|
||||
var ANY: any;
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
|
||||
var BOOLEAN: boolean;
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
var NUMBER: number;
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3))
|
||||
|
||||
var STRING: string;
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3))
|
||||
|
||||
var OBJECT: Object;
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 5, 3))
|
||||
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
|
||||
//The second operand type is boolean
|
||||
ANY, BOOLEAN;
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
BOOLEAN, BOOLEAN;
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
NUMBER, BOOLEAN;
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
STRING, BOOLEAN;
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
OBJECT, BOOLEAN;
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 5, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
//Return type is boolean
|
||||
var resultIsBoolean1 = (ANY, BOOLEAN);
|
||||
>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(commaOperatorWithSecondOperandBooleanType.ts, 14, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(commaOperatorWithSecondOperandBooleanType.ts, 15, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
var resultIsBoolean2 = (BOOLEAN, BOOLEAN);
|
||||
>resultIsBoolean2 : Symbol(resultIsBoolean2, Decl(commaOperatorWithSecondOperandBooleanType.ts, 15, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>resultIsBoolean2 : Symbol(resultIsBoolean2, Decl(commaOperatorWithSecondOperandBooleanType.ts, 16, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
var resultIsBoolean3 = (NUMBER, BOOLEAN);
|
||||
>resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(commaOperatorWithSecondOperandBooleanType.ts, 16, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>resultIsBoolean3 : Symbol(resultIsBoolean3, Decl(commaOperatorWithSecondOperandBooleanType.ts, 17, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
var resultIsBoolean4 = (STRING, BOOLEAN);
|
||||
>resultIsBoolean4 : Symbol(resultIsBoolean4, Decl(commaOperatorWithSecondOperandBooleanType.ts, 17, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>resultIsBoolean4 : Symbol(resultIsBoolean4, Decl(commaOperatorWithSecondOperandBooleanType.ts, 18, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
var resultIsBoolean5 = (OBJECT, BOOLEAN);
|
||||
>resultIsBoolean5 : Symbol(resultIsBoolean5, Decl(commaOperatorWithSecondOperandBooleanType.ts, 18, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>resultIsBoolean5 : Symbol(resultIsBoolean5, Decl(commaOperatorWithSecondOperandBooleanType.ts, 19, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 5, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
//Literal and expression
|
||||
null, BOOLEAN;
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
ANY = undefined, BOOLEAN;
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>undefined : Symbol(undefined)
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
1, true;
|
||||
++NUMBER, true;
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3))
|
||||
|
||||
[1, 2, 3], !BOOLEAN;
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
OBJECT = [1, 2, 3], BOOLEAN = false;
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 5, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
var resultIsBoolean6 = (null, BOOLEAN);
|
||||
>resultIsBoolean6 : Symbol(resultIsBoolean6, Decl(commaOperatorWithSecondOperandBooleanType.ts, 28, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>resultIsBoolean6 : Symbol(resultIsBoolean6, Decl(commaOperatorWithSecondOperandBooleanType.ts, 29, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
var resultIsBoolean7 = (ANY = undefined, BOOLEAN);
|
||||
>resultIsBoolean7 : Symbol(resultIsBoolean7, Decl(commaOperatorWithSecondOperandBooleanType.ts, 29, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 0, 3))
|
||||
>resultIsBoolean7 : Symbol(resultIsBoolean7, Decl(commaOperatorWithSecondOperandBooleanType.ts, 30, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>undefined : Symbol(undefined)
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
var resultIsBoolean8 = (1, true);
|
||||
>resultIsBoolean8 : Symbol(resultIsBoolean8, Decl(commaOperatorWithSecondOperandBooleanType.ts, 30, 3))
|
||||
>resultIsBoolean8 : Symbol(resultIsBoolean8, Decl(commaOperatorWithSecondOperandBooleanType.ts, 31, 3))
|
||||
|
||||
var resultIsBoolean9 = (++NUMBER, true);
|
||||
>resultIsBoolean9 : Symbol(resultIsBoolean9, Decl(commaOperatorWithSecondOperandBooleanType.ts, 31, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
>resultIsBoolean9 : Symbol(resultIsBoolean9, Decl(commaOperatorWithSecondOperandBooleanType.ts, 32, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandBooleanType.ts, 3, 3))
|
||||
|
||||
var resultIsBoolean10 = ([1, 2, 3], !BOOLEAN);
|
||||
>resultIsBoolean10 : Symbol(resultIsBoolean10, Decl(commaOperatorWithSecondOperandBooleanType.ts, 32, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>resultIsBoolean10 : Symbol(resultIsBoolean10, Decl(commaOperatorWithSecondOperandBooleanType.ts, 33, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
var resultIsBoolean11 = (OBJECT = [1, 2, 3], BOOLEAN = false);
|
||||
>resultIsBoolean11 : Symbol(resultIsBoolean11, Decl(commaOperatorWithSecondOperandBooleanType.ts, 33, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 4, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 1, 3))
|
||||
>resultIsBoolean11 : Symbol(resultIsBoolean11, Decl(commaOperatorWithSecondOperandBooleanType.ts, 34, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandBooleanType.ts, 5, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandBooleanType.ts, 2, 3))
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandBooleanType.ts ===
|
||||
|
||||
var ANY: any;
|
||||
>ANY : any
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [commaOperatorWithSecondOperandNumberType.ts]
|
||||
|
||||
var ANY: any;
|
||||
var BOOLEAN: boolean;
|
||||
var NUMBER: number;
|
||||
|
||||
@@ -1,114 +1,115 @@
|
||||
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandNumberType.ts ===
|
||||
|
||||
var ANY: any;
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
|
||||
|
||||
var BOOLEAN: boolean;
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
|
||||
var NUMBER: number;
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
var STRING: string;
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3))
|
||||
|
||||
var OBJECT: Object;
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 5, 3))
|
||||
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
|
||||
//The second operand type is number
|
||||
ANY, NUMBER;
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
BOOLEAN, NUMBER;
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
NUMBER, NUMBER;
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
STRING, NUMBER;
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
OBJECT, NUMBER;
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 5, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
//Return type is number
|
||||
var resultIsNumber1 = (ANY, NUMBER);
|
||||
>resultIsNumber1 : Symbol(resultIsNumber1, Decl(commaOperatorWithSecondOperandNumberType.ts, 14, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>resultIsNumber1 : Symbol(resultIsNumber1, Decl(commaOperatorWithSecondOperandNumberType.ts, 15, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
var resultIsNumber2 = (BOOLEAN, NUMBER);
|
||||
>resultIsNumber2 : Symbol(resultIsNumber2, Decl(commaOperatorWithSecondOperandNumberType.ts, 15, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>resultIsNumber2 : Symbol(resultIsNumber2, Decl(commaOperatorWithSecondOperandNumberType.ts, 16, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
var resultIsNumber3 = (NUMBER, NUMBER);
|
||||
>resultIsNumber3 : Symbol(resultIsNumber3, Decl(commaOperatorWithSecondOperandNumberType.ts, 16, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>resultIsNumber3 : Symbol(resultIsNumber3, Decl(commaOperatorWithSecondOperandNumberType.ts, 17, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
var resultIsNumber4 = (STRING, NUMBER);
|
||||
>resultIsNumber4 : Symbol(resultIsNumber4, Decl(commaOperatorWithSecondOperandNumberType.ts, 17, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>resultIsNumber4 : Symbol(resultIsNumber4, Decl(commaOperatorWithSecondOperandNumberType.ts, 18, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
var resultIsNumber5 = (OBJECT, NUMBER);
|
||||
>resultIsNumber5 : Symbol(resultIsNumber5, Decl(commaOperatorWithSecondOperandNumberType.ts, 18, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>resultIsNumber5 : Symbol(resultIsNumber5, Decl(commaOperatorWithSecondOperandNumberType.ts, 19, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandNumberType.ts, 5, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
//Literal and expression
|
||||
null, NUMBER;
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
ANY = undefined, NUMBER;
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
|
||||
>undefined : Symbol(undefined)
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
true, 1;
|
||||
BOOLEAN = false, 1;
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
|
||||
"", NUMBER = 1;
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
STRING.trim(), NUMBER = 1;
|
||||
>STRING.trim : Symbol(String.trim, Decl(lib.d.ts, --, --))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3))
|
||||
>trim : Symbol(String.trim, Decl(lib.d.ts, --, --))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
var resultIsNumber6 = (null, NUMBER);
|
||||
>resultIsNumber6 : Symbol(resultIsNumber6, Decl(commaOperatorWithSecondOperandNumberType.ts, 28, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>resultIsNumber6 : Symbol(resultIsNumber6, Decl(commaOperatorWithSecondOperandNumberType.ts, 29, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
var resultIsNumber7 = (ANY = undefined, NUMBER);
|
||||
>resultIsNumber7 : Symbol(resultIsNumber7, Decl(commaOperatorWithSecondOperandNumberType.ts, 29, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 0, 3))
|
||||
>resultIsNumber7 : Symbol(resultIsNumber7, Decl(commaOperatorWithSecondOperandNumberType.ts, 30, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
|
||||
>undefined : Symbol(undefined)
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
var resultIsNumber8 = (true, 1);
|
||||
>resultIsNumber8 : Symbol(resultIsNumber8, Decl(commaOperatorWithSecondOperandNumberType.ts, 30, 3))
|
||||
>resultIsNumber8 : Symbol(resultIsNumber8, Decl(commaOperatorWithSecondOperandNumberType.ts, 31, 3))
|
||||
|
||||
var resultIsNumber9 = (BOOLEAN = false, 1);
|
||||
>resultIsNumber9 : Symbol(resultIsNumber9, Decl(commaOperatorWithSecondOperandNumberType.ts, 31, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 1, 3))
|
||||
>resultIsNumber9 : Symbol(resultIsNumber9, Decl(commaOperatorWithSecondOperandNumberType.ts, 32, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
|
||||
var resultIsNumber10 = ("", NUMBER = 1);
|
||||
>resultIsNumber10 : Symbol(resultIsNumber10, Decl(commaOperatorWithSecondOperandNumberType.ts, 32, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>resultIsNumber10 : Symbol(resultIsNumber10, Decl(commaOperatorWithSecondOperandNumberType.ts, 33, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
var resultIsNumber11 = (STRING.trim(), NUMBER = 1);
|
||||
>resultIsNumber11 : Symbol(resultIsNumber11, Decl(commaOperatorWithSecondOperandNumberType.ts, 33, 3))
|
||||
>resultIsNumber11 : Symbol(resultIsNumber11, Decl(commaOperatorWithSecondOperandNumberType.ts, 34, 3))
|
||||
>STRING.trim : Symbol(String.trim, Decl(lib.d.ts, --, --))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandNumberType.ts, 4, 3))
|
||||
>trim : Symbol(String.trim, Decl(lib.d.ts, --, --))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandNumberType.ts, 3, 3))
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandNumberType.ts ===
|
||||
|
||||
var ANY: any;
|
||||
>ANY : any
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [commaOperatorWithSecondOperandObjectType.ts]
|
||||
|
||||
var ANY: any;
|
||||
var BOOLEAN: boolean;
|
||||
var NUMBER: number;
|
||||
|
||||
@@ -1,121 +1,122 @@
|
||||
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandObjectType.ts ===
|
||||
|
||||
var ANY: any;
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
|
||||
|
||||
var BOOLEAN: boolean;
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3))
|
||||
|
||||
var NUMBER: number;
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3))
|
||||
|
||||
var STRING: string;
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
|
||||
var OBJECT: Object;
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
|
||||
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
|
||||
class CLASS {
|
||||
>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 19))
|
||||
>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 19))
|
||||
|
||||
num: number;
|
||||
>num : Symbol(CLASS.num, Decl(commaOperatorWithSecondOperandObjectType.ts, 6, 13))
|
||||
>num : Symbol(CLASS.num, Decl(commaOperatorWithSecondOperandObjectType.ts, 7, 13))
|
||||
}
|
||||
|
||||
//The second operand type is Object
|
||||
ANY, OBJECT;
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
|
||||
|
||||
BOOLEAN, OBJECT;
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
|
||||
|
||||
NUMBER, OBJECT;
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
|
||||
|
||||
STRING, OBJECT;
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
|
||||
|
||||
OBJECT, OBJECT;
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
|
||||
|
||||
//Return type is Object
|
||||
var resultIsObject1 = (ANY, OBJECT);
|
||||
>resultIsObject1 : Symbol(resultIsObject1, Decl(commaOperatorWithSecondOperandObjectType.ts, 18, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>resultIsObject1 : Symbol(resultIsObject1, Decl(commaOperatorWithSecondOperandObjectType.ts, 19, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
|
||||
|
||||
var resultIsObject2 = (BOOLEAN, OBJECT);
|
||||
>resultIsObject2 : Symbol(resultIsObject2, Decl(commaOperatorWithSecondOperandObjectType.ts, 19, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>resultIsObject2 : Symbol(resultIsObject2, Decl(commaOperatorWithSecondOperandObjectType.ts, 20, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
|
||||
|
||||
var resultIsObject3 = (NUMBER, OBJECT);
|
||||
>resultIsObject3 : Symbol(resultIsObject3, Decl(commaOperatorWithSecondOperandObjectType.ts, 20, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>resultIsObject3 : Symbol(resultIsObject3, Decl(commaOperatorWithSecondOperandObjectType.ts, 21, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
|
||||
|
||||
var resultIsObject4 = (STRING, OBJECT);
|
||||
>resultIsObject4 : Symbol(resultIsObject4, Decl(commaOperatorWithSecondOperandObjectType.ts, 21, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>resultIsObject4 : Symbol(resultIsObject4, Decl(commaOperatorWithSecondOperandObjectType.ts, 22, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
|
||||
|
||||
var resultIsObject5 = (OBJECT, OBJECT);
|
||||
>resultIsObject5 : Symbol(resultIsObject5, Decl(commaOperatorWithSecondOperandObjectType.ts, 22, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>resultIsObject5 : Symbol(resultIsObject5, Decl(commaOperatorWithSecondOperandObjectType.ts, 23, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
|
||||
|
||||
//Literal and expression
|
||||
null, OBJECT
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
|
||||
|
||||
ANY = null, OBJECT
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
|
||||
|
||||
true, {}
|
||||
!BOOLEAN, []
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3))
|
||||
|
||||
"string", new Date()
|
||||
>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
|
||||
STRING.toLowerCase(), new CLASS()
|
||||
>STRING.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --))
|
||||
>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 19))
|
||||
>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 19))
|
||||
|
||||
var resultIsObject6 = (null, OBJECT);
|
||||
>resultIsObject6 : Symbol(resultIsObject6, Decl(commaOperatorWithSecondOperandObjectType.ts, 32, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>resultIsObject6 : Symbol(resultIsObject6, Decl(commaOperatorWithSecondOperandObjectType.ts, 33, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
|
||||
|
||||
var resultIsObject7 = (ANY = null, OBJECT);
|
||||
>resultIsObject7 : Symbol(resultIsObject7, Decl(commaOperatorWithSecondOperandObjectType.ts, 33, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 0, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>resultIsObject7 : Symbol(resultIsObject7, Decl(commaOperatorWithSecondOperandObjectType.ts, 34, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 3))
|
||||
|
||||
var resultIsObject8 = (true, {});
|
||||
>resultIsObject8 : Symbol(resultIsObject8, Decl(commaOperatorWithSecondOperandObjectType.ts, 34, 3))
|
||||
>resultIsObject8 : Symbol(resultIsObject8, Decl(commaOperatorWithSecondOperandObjectType.ts, 35, 3))
|
||||
|
||||
var resultIsObject9 = (!BOOLEAN, { a: 1, b: "s" });
|
||||
>resultIsObject9 : Symbol(resultIsObject9, Decl(commaOperatorWithSecondOperandObjectType.ts, 35, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 1, 3))
|
||||
>a : Symbol(a, Decl(commaOperatorWithSecondOperandObjectType.ts, 35, 34))
|
||||
>b : Symbol(b, Decl(commaOperatorWithSecondOperandObjectType.ts, 35, 40))
|
||||
>resultIsObject9 : Symbol(resultIsObject9, Decl(commaOperatorWithSecondOperandObjectType.ts, 36, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandObjectType.ts, 2, 3))
|
||||
>a : Symbol(a, Decl(commaOperatorWithSecondOperandObjectType.ts, 36, 34))
|
||||
>b : Symbol(b, Decl(commaOperatorWithSecondOperandObjectType.ts, 36, 40))
|
||||
|
||||
var resultIsObject10 = ("string", new Date());
|
||||
>resultIsObject10 : Symbol(resultIsObject10, Decl(commaOperatorWithSecondOperandObjectType.ts, 36, 3))
|
||||
>resultIsObject10 : Symbol(resultIsObject10, Decl(commaOperatorWithSecondOperandObjectType.ts, 37, 3))
|
||||
>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
|
||||
var resultIsObject11 = (STRING.toLowerCase(), new CLASS());
|
||||
>resultIsObject11 : Symbol(resultIsObject11, Decl(commaOperatorWithSecondOperandObjectType.ts, 37, 3))
|
||||
>resultIsObject11 : Symbol(resultIsObject11, Decl(commaOperatorWithSecondOperandObjectType.ts, 38, 3))
|
||||
>STRING.toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 3))
|
||||
>toLowerCase : Symbol(String.toLowerCase, Decl(lib.d.ts, --, --))
|
||||
>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 4, 19))
|
||||
>CLASS : Symbol(CLASS, Decl(commaOperatorWithSecondOperandObjectType.ts, 5, 19))
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandObjectType.ts ===
|
||||
|
||||
var ANY: any;
|
||||
>ANY : any
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [commaOperatorWithSecondOperandStringType.ts]
|
||||
|
||||
var ANY: any;
|
||||
var BOOLEAN: boolean;
|
||||
var NUMBER: number;
|
||||
|
||||
@@ -1,120 +1,121 @@
|
||||
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandStringType.ts ===
|
||||
|
||||
var ANY: any;
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
|
||||
|
||||
var BOOLEAN: boolean;
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
|
||||
|
||||
var NUMBER: number;
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
|
||||
var STRING: string;
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
|
||||
var OBJECT: Object;
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 5, 3))
|
||||
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
|
||||
var resultIsString: string;
|
||||
>resultIsString : Symbol(resultIsString, Decl(commaOperatorWithSecondOperandStringType.ts, 6, 3))
|
||||
>resultIsString : Symbol(resultIsString, Decl(commaOperatorWithSecondOperandStringType.ts, 7, 3))
|
||||
|
||||
//The second operand is string
|
||||
ANY, STRING;
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
|
||||
BOOLEAN, STRING;
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
|
||||
NUMBER, STRING;
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
|
||||
STRING, STRING;
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
|
||||
OBJECT, STRING;
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 5, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
|
||||
//Return type is string
|
||||
var resultIsString1 = (ANY, STRING);
|
||||
>resultIsString1 : Symbol(resultIsString1, Decl(commaOperatorWithSecondOperandStringType.ts, 16, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>resultIsString1 : Symbol(resultIsString1, Decl(commaOperatorWithSecondOperandStringType.ts, 17, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
|
||||
var resultIsString2 = (BOOLEAN, STRING);
|
||||
>resultIsString2 : Symbol(resultIsString2, Decl(commaOperatorWithSecondOperandStringType.ts, 17, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>resultIsString2 : Symbol(resultIsString2, Decl(commaOperatorWithSecondOperandStringType.ts, 18, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
|
||||
var resultIsString3 = (NUMBER, STRING);
|
||||
>resultIsString3 : Symbol(resultIsString3, Decl(commaOperatorWithSecondOperandStringType.ts, 18, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>resultIsString3 : Symbol(resultIsString3, Decl(commaOperatorWithSecondOperandStringType.ts, 19, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
|
||||
var resultIsString4 = (STRING, STRING);
|
||||
>resultIsString4 : Symbol(resultIsString4, Decl(commaOperatorWithSecondOperandStringType.ts, 19, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>resultIsString4 : Symbol(resultIsString4, Decl(commaOperatorWithSecondOperandStringType.ts, 20, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
|
||||
var resultIsString5 = (OBJECT, STRING);
|
||||
>resultIsString5 : Symbol(resultIsString5, Decl(commaOperatorWithSecondOperandStringType.ts, 20, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>resultIsString5 : Symbol(resultIsString5, Decl(commaOperatorWithSecondOperandStringType.ts, 21, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 5, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
|
||||
//Literal and expression
|
||||
null, STRING;
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
|
||||
ANY = new Date(), STRING;
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
|
||||
>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
|
||||
true, "";
|
||||
BOOLEAN == undefined, "";
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
|
||||
>undefined : Symbol(undefined)
|
||||
|
||||
["a", "b"], NUMBER.toString();
|
||||
>NUMBER.toString : Symbol(Number.toString, Decl(lib.d.ts, --, --))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, --, --))
|
||||
|
||||
OBJECT = new Object, STRING + "string";
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorWithSecondOperandStringType.ts, 5, 3))
|
||||
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
|
||||
var resultIsString6 = (null, STRING);
|
||||
>resultIsString6 : Symbol(resultIsString6, Decl(commaOperatorWithSecondOperandStringType.ts, 30, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>resultIsString6 : Symbol(resultIsString6, Decl(commaOperatorWithSecondOperandStringType.ts, 31, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
|
||||
var resultIsString7 = (ANY = new Date(), STRING);
|
||||
>resultIsString7 : Symbol(resultIsString7, Decl(commaOperatorWithSecondOperandStringType.ts, 31, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 0, 3))
|
||||
>resultIsString7 : Symbol(resultIsString7, Decl(commaOperatorWithSecondOperandStringType.ts, 32, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
|
||||
>Date : Symbol(Date, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
|
||||
var resultIsString8 = (true, "");
|
||||
>resultIsString8 : Symbol(resultIsString8, Decl(commaOperatorWithSecondOperandStringType.ts, 32, 3))
|
||||
>resultIsString8 : Symbol(resultIsString8, Decl(commaOperatorWithSecondOperandStringType.ts, 33, 3))
|
||||
|
||||
var resultIsString9 = (BOOLEAN == undefined, "");
|
||||
>resultIsString9 : Symbol(resultIsString9, Decl(commaOperatorWithSecondOperandStringType.ts, 33, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 1, 3))
|
||||
>resultIsString9 : Symbol(resultIsString9, Decl(commaOperatorWithSecondOperandStringType.ts, 34, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
|
||||
>undefined : Symbol(undefined)
|
||||
|
||||
var resultIsString10 = (["a", "b"], NUMBER.toString());
|
||||
>resultIsString10 : Symbol(resultIsString10, Decl(commaOperatorWithSecondOperandStringType.ts, 34, 3))
|
||||
>resultIsString10 : Symbol(resultIsString10, Decl(commaOperatorWithSecondOperandStringType.ts, 35, 3))
|
||||
>NUMBER.toString : Symbol(Number.toString, Decl(lib.d.ts, --, --))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>toString : Symbol(Number.toString, Decl(lib.d.ts, --, --))
|
||||
|
||||
var resultIsString11 = (new Object, STRING + "string");
|
||||
>resultIsString11 : Symbol(resultIsString11, Decl(commaOperatorWithSecondOperandStringType.ts, 35, 3))
|
||||
>resultIsString11 : Symbol(resultIsString11, Decl(commaOperatorWithSecondOperandStringType.ts, 36, 3))
|
||||
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorWithSecondOperandStringType.ts, 4, 3))
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/expressions/commaOperator/commaOperatorWithSecondOperandStringType.ts ===
|
||||
|
||||
var ANY: any;
|
||||
>ANY : any
|
||||
|
||||
|
||||
@@ -1,18 +1,29 @@
|
||||
tests/cases/conformance/expressions/commaOperator/commaOperatorWithoutOperand.ts(9,2): error 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.
|
||||
~
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [commaOperatorsMultipleOperators.ts]
|
||||
|
||||
var ANY: any;
|
||||
var BOOLEAN: boolean;
|
||||
var NUMBER: number;
|
||||
|
||||
@@ -1,94 +1,95 @@
|
||||
=== tests/cases/conformance/expressions/commaOperator/commaOperatorsMultipleOperators.ts ===
|
||||
|
||||
var ANY: any;
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
|
||||
|
||||
var BOOLEAN: boolean;
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
|
||||
|
||||
var NUMBER: number;
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
|
||||
|
||||
var STRING: string;
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
|
||||
|
||||
var OBJECT: Object;
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3))
|
||||
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
|
||||
//Expected: work well
|
||||
ANY, BOOLEAN, NUMBER;
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
|
||||
|
||||
BOOLEAN, NUMBER, STRING;
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
|
||||
|
||||
NUMBER, STRING, OBJECT;
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3))
|
||||
|
||||
STRING, OBJECT, ANY;
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
|
||||
|
||||
OBJECT, ANY, BOOLEAN;
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
|
||||
|
||||
//Results should have the same type as the third operand
|
||||
var resultIsAny1 = (STRING, OBJECT, ANY);
|
||||
>resultIsAny1 : Symbol(resultIsAny1, Decl(commaOperatorsMultipleOperators.ts, 14, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3))
|
||||
>resultIsAny1 : Symbol(resultIsAny1, Decl(commaOperatorsMultipleOperators.ts, 15, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
|
||||
|
||||
var resultIsBoolean1 = (OBJECT, ANY, BOOLEAN);
|
||||
>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(commaOperatorsMultipleOperators.ts, 15, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
|
||||
>resultIsBoolean1 : Symbol(resultIsBoolean1, Decl(commaOperatorsMultipleOperators.ts, 16, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
|
||||
|
||||
var resultIsNumber1 = (ANY, BOOLEAN, NUMBER);
|
||||
>resultIsNumber1 : Symbol(resultIsNumber1, Decl(commaOperatorsMultipleOperators.ts, 16, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 0, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
|
||||
>resultIsNumber1 : Symbol(resultIsNumber1, Decl(commaOperatorsMultipleOperators.ts, 17, 3))
|
||||
>ANY : Symbol(ANY, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
|
||||
|
||||
var resultIsString1 = (BOOLEAN, NUMBER, STRING);
|
||||
>resultIsString1 : Symbol(resultIsString1, Decl(commaOperatorsMultipleOperators.ts, 17, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 1, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
|
||||
>resultIsString1 : Symbol(resultIsString1, Decl(commaOperatorsMultipleOperators.ts, 18, 3))
|
||||
>BOOLEAN : Symbol(BOOLEAN, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
|
||||
|
||||
var resultIsObject1 = (NUMBER, STRING, OBJECT);
|
||||
>resultIsObject1 : Symbol(resultIsObject1, Decl(commaOperatorsMultipleOperators.ts, 18, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
|
||||
>resultIsObject1 : Symbol(resultIsObject1, Decl(commaOperatorsMultipleOperators.ts, 19, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
|
||||
>OBJECT : Symbol(OBJECT, Decl(commaOperatorsMultipleOperators.ts, 5, 3))
|
||||
|
||||
//Literal and expression
|
||||
null, true, 1;
|
||||
++NUMBER, STRING.charAt(0), new Object();
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
|
||||
>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
|
||||
>charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --))
|
||||
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
|
||||
var resultIsNumber2 = (null, true, 1);
|
||||
>resultIsNumber2 : Symbol(resultIsNumber2, Decl(commaOperatorsMultipleOperators.ts, 24, 3))
|
||||
>resultIsNumber2 : Symbol(resultIsNumber2, Decl(commaOperatorsMultipleOperators.ts, 25, 3))
|
||||
|
||||
var resultIsObject2 = (++NUMBER, STRING.charAt(0), new Object());
|
||||
>resultIsObject2 : Symbol(resultIsObject2, Decl(commaOperatorsMultipleOperators.ts, 25, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 2, 3))
|
||||
>resultIsObject2 : Symbol(resultIsObject2, Decl(commaOperatorsMultipleOperators.ts, 26, 3))
|
||||
>NUMBER : Symbol(NUMBER, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
|
||||
>STRING.charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 3, 3))
|
||||
>STRING : Symbol(STRING, Decl(commaOperatorsMultipleOperators.ts, 4, 3))
|
||||
>charAt : Symbol(String.charAt, Decl(lib.d.ts, --, --))
|
||||
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/expressions/commaOperator/commaOperatorsMultipleOperators.ts ===
|
||||
|
||||
var ANY: any;
|
||||
>ANY : any
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [controlFlowIfStatement.ts]
|
||||
|
||||
let x: string | number | boolean | RegExp;
|
||||
let cond: boolean;
|
||||
|
||||
|
||||
@@ -1,112 +1,113 @@
|
||||
=== tests/cases/conformance/controlFlow/controlFlowIfStatement.ts ===
|
||||
|
||||
let x: string | number | boolean | RegExp;
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3))
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3))
|
||||
>RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
|
||||
let cond: boolean;
|
||||
>cond : Symbol(cond, Decl(controlFlowIfStatement.ts, 1, 3))
|
||||
>cond : Symbol(cond, Decl(controlFlowIfStatement.ts, 2, 3))
|
||||
|
||||
x = /a/;
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3))
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3))
|
||||
|
||||
if (x /* RegExp */, (x = true)) {
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3))
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3))
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3))
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3))
|
||||
|
||||
x; // boolean
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3))
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3))
|
||||
|
||||
x = "";
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3))
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3))
|
||||
}
|
||||
else {
|
||||
x; // boolean
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3))
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3))
|
||||
|
||||
x = 42;
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3))
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3))
|
||||
}
|
||||
x; // string | number
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 0, 3))
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 1, 3))
|
||||
|
||||
function a() {
|
||||
>a : Symbol(a, Decl(controlFlowIfStatement.ts, 12, 2))
|
||||
>a : Symbol(a, Decl(controlFlowIfStatement.ts, 13, 2))
|
||||
|
||||
let x: string | number;
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 15, 7))
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 16, 7))
|
||||
|
||||
if (cond) {
|
||||
>cond : Symbol(cond, Decl(controlFlowIfStatement.ts, 1, 3))
|
||||
>cond : Symbol(cond, Decl(controlFlowIfStatement.ts, 2, 3))
|
||||
|
||||
x = 42;
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 15, 7))
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 16, 7))
|
||||
}
|
||||
else {
|
||||
x = "";
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 15, 7))
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 16, 7))
|
||||
|
||||
return;
|
||||
}
|
||||
x; // number
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 15, 7))
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 16, 7))
|
||||
}
|
||||
function b() {
|
||||
>b : Symbol(b, Decl(controlFlowIfStatement.ts, 24, 1))
|
||||
>b : Symbol(b, Decl(controlFlowIfStatement.ts, 25, 1))
|
||||
|
||||
let x: string | number;
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 26, 7))
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 27, 7))
|
||||
|
||||
if (cond) {
|
||||
>cond : Symbol(cond, Decl(controlFlowIfStatement.ts, 1, 3))
|
||||
>cond : Symbol(cond, Decl(controlFlowIfStatement.ts, 2, 3))
|
||||
|
||||
x = 42;
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 26, 7))
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 27, 7))
|
||||
|
||||
throw "";
|
||||
}
|
||||
else {
|
||||
x = "";
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 26, 7))
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 27, 7))
|
||||
}
|
||||
x; // string
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 26, 7))
|
||||
>x : Symbol(x, Decl(controlFlowIfStatement.ts, 27, 7))
|
||||
}
|
||||
function c<T>(data: string | T): T {
|
||||
>c : Symbol(c, Decl(controlFlowIfStatement.ts, 35, 1))
|
||||
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 36, 11))
|
||||
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 36, 14))
|
||||
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 36, 11))
|
||||
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 36, 11))
|
||||
>c : Symbol(c, Decl(controlFlowIfStatement.ts, 36, 1))
|
||||
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 37, 11))
|
||||
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 37, 14))
|
||||
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 37, 11))
|
||||
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 37, 11))
|
||||
|
||||
if (typeof data === 'string') {
|
||||
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 36, 14))
|
||||
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 37, 14))
|
||||
|
||||
return JSON.parse(data);
|
||||
>JSON.parse : Symbol(JSON.parse, Decl(lib.d.ts, --, --))
|
||||
>JSON : Symbol(JSON, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>parse : Symbol(JSON.parse, Decl(lib.d.ts, --, --))
|
||||
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 36, 14))
|
||||
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 37, 14))
|
||||
}
|
||||
else {
|
||||
return data;
|
||||
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 36, 14))
|
||||
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 37, 14))
|
||||
}
|
||||
}
|
||||
function d<T extends string>(data: string | T): never {
|
||||
>d : Symbol(d, Decl(controlFlowIfStatement.ts, 43, 1))
|
||||
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 44, 11))
|
||||
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 44, 29))
|
||||
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 44, 11))
|
||||
>d : Symbol(d, Decl(controlFlowIfStatement.ts, 44, 1))
|
||||
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 45, 11))
|
||||
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 45, 29))
|
||||
>T : Symbol(T, Decl(controlFlowIfStatement.ts, 45, 11))
|
||||
|
||||
if (typeof data === 'string') {
|
||||
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 44, 29))
|
||||
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 45, 29))
|
||||
|
||||
throw new Error('will always happen');
|
||||
>Error : Symbol(Error, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
}
|
||||
else {
|
||||
return data;
|
||||
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 44, 29))
|
||||
>data : Symbol(data, Decl(controlFlowIfStatement.ts, 45, 29))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/conformance/controlFlow/controlFlowIfStatement.ts ===
|
||||
|
||||
let x: string | number | boolean | RegExp;
|
||||
>x : string | number | boolean | RegExp
|
||||
>RegExp : RegExp
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(7,18): error TS1005: ':' expected.
|
||||
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,14): error TS1181: Array element destructuring pattern expected.
|
||||
tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration6.ts(9,19): error 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.
|
||||
~~~~~~
|
||||
|
||||
@@ -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'.
|
||||
~
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//// [inferentialTypingWithFunctionTypeSyntacticScenarios.ts]
|
||||
|
||||
declare function map<T, U>(array: T, func: (x: T) => U): U;
|
||||
declare function identity<V>(y: V): V;
|
||||
var s: string;
|
||||
|
||||
+45
-44
@@ -1,94 +1,95 @@
|
||||
=== tests/cases/compiler/inferentialTypingWithFunctionTypeSyntacticScenarios.ts ===
|
||||
|
||||
declare function map<T, U>(array: T, func: (x: T) => U): U;
|
||||
>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 21))
|
||||
>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 23))
|
||||
>array : Symbol(array, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 27))
|
||||
>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 21))
|
||||
>func : Symbol(func, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 36))
|
||||
>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 44))
|
||||
>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 21))
|
||||
>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 23))
|
||||
>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 23))
|
||||
>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 21))
|
||||
>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 23))
|
||||
>array : Symbol(array, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 27))
|
||||
>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 21))
|
||||
>func : Symbol(func, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 36))
|
||||
>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 44))
|
||||
>T : Symbol(T, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 21))
|
||||
>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 23))
|
||||
>U : Symbol(U, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 23))
|
||||
|
||||
declare function identity<V>(y: V): V;
|
||||
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59))
|
||||
>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 26))
|
||||
>y : Symbol(y, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 29))
|
||||
>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 26))
|
||||
>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 26))
|
||||
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59))
|
||||
>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 26))
|
||||
>y : Symbol(y, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 29))
|
||||
>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 26))
|
||||
>V : Symbol(V, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 26))
|
||||
|
||||
var s: string;
|
||||
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3))
|
||||
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3))
|
||||
|
||||
// dotted name
|
||||
var dottedIdentity = { x: identity };
|
||||
>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 3))
|
||||
>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22))
|
||||
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59))
|
||||
>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 3))
|
||||
>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 22))
|
||||
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59))
|
||||
|
||||
s = map("", dottedIdentity.x);
|
||||
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3))
|
||||
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3))
|
||||
>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0))
|
||||
>dottedIdentity.x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22))
|
||||
>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 3))
|
||||
>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22))
|
||||
>dottedIdentity.x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 22))
|
||||
>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 3))
|
||||
>x : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 22))
|
||||
|
||||
// index expression
|
||||
s = map("", dottedIdentity['x']);
|
||||
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3))
|
||||
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3))
|
||||
>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0))
|
||||
>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 3))
|
||||
>'x' : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 5, 22))
|
||||
>dottedIdentity : Symbol(dottedIdentity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 3))
|
||||
>'x' : Symbol(x, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 6, 22))
|
||||
|
||||
// function call
|
||||
s = map("", (() => identity)());
|
||||
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3))
|
||||
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3))
|
||||
>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0))
|
||||
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59))
|
||||
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59))
|
||||
|
||||
// construct
|
||||
interface IdentityConstructor {
|
||||
>IdentityConstructor : Symbol(IdentityConstructor, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 12, 32))
|
||||
>IdentityConstructor : Symbol(IdentityConstructor, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 13, 32))
|
||||
|
||||
new (): typeof identity;
|
||||
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59))
|
||||
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59))
|
||||
}
|
||||
var ic: IdentityConstructor;
|
||||
>ic : Symbol(ic, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 18, 3))
|
||||
>IdentityConstructor : Symbol(IdentityConstructor, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 12, 32))
|
||||
>ic : Symbol(ic, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 19, 3))
|
||||
>IdentityConstructor : Symbol(IdentityConstructor, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 13, 32))
|
||||
|
||||
s = map("", new ic());
|
||||
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3))
|
||||
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3))
|
||||
>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0))
|
||||
>ic : Symbol(ic, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 18, 3))
|
||||
>ic : Symbol(ic, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 19, 3))
|
||||
|
||||
// assignment
|
||||
var t;
|
||||
>t : Symbol(t, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 22, 3))
|
||||
>t : Symbol(t, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 23, 3))
|
||||
|
||||
s = map("", t = identity);
|
||||
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3))
|
||||
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3))
|
||||
>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0))
|
||||
>t : Symbol(t, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 22, 3))
|
||||
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59))
|
||||
>t : Symbol(t, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 23, 3))
|
||||
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59))
|
||||
|
||||
// type assertion
|
||||
s = map("", <typeof identity>identity);
|
||||
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3))
|
||||
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3))
|
||||
>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0))
|
||||
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59))
|
||||
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59))
|
||||
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59))
|
||||
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59))
|
||||
|
||||
// parenthesized expression
|
||||
s = map("", (identity));
|
||||
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3))
|
||||
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3))
|
||||
>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0))
|
||||
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59))
|
||||
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59))
|
||||
|
||||
// comma
|
||||
s = map("", ("", identity));
|
||||
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 2, 3))
|
||||
>s : Symbol(s, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 3, 3))
|
||||
>map : Symbol(map, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 0))
|
||||
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 0, 59))
|
||||
>identity : Symbol(identity, Decl(inferentialTypingWithFunctionTypeSyntacticScenarios.ts, 1, 59))
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
=== tests/cases/compiler/inferentialTypingWithFunctionTypeSyntacticScenarios.ts ===
|
||||
|
||||
declare function map<T, U>(array: T, func: (x: T) => U): U;
|
||||
>map : <T, U>(array: T, func: (x: T) => U) => U
|
||||
>T : T
|
||||
|
||||
@@ -1,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);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// @lib: es5,es2015.promise
|
||||
// @noEmitHelpers: true
|
||||
// @allowUnreachableCode: true
|
||||
// @target: ES5
|
||||
declare var x, y, z, a, b, c;
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// @allowUnreachableCode: true
|
||||
|
||||
declare function map<T, U>(array: T, func: (x: T) => U): U;
|
||||
declare function identity<V>(y: V): V;
|
||||
var s: string;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// @allowUnreachableCode: true
|
||||
|
||||
let x: string | number | boolean | RegExp;
|
||||
let cond: boolean;
|
||||
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// @allowUnreachableCode: true
|
||||
|
||||
var BOOLEAN: boolean;
|
||||
var NUMBER: number;
|
||||
var STRING: string;
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// @allowUnreachableCode: true
|
||||
|
||||
//Expect to have compiler errors
|
||||
//Comma operator in fuction arguments and return
|
||||
function foo(x: number, y: string) {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// @allowUnreachableCode: true
|
||||
|
||||
//Comma operator in for loop
|
||||
for (var i = 0, j = 10; i < j; i++, j--)
|
||||
{
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// @allowUnreachableCode: true
|
||||
|
||||
var ANY: any;
|
||||
var BOOLEAN: boolean;
|
||||
var NUMBER: number;
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// @allowUnreachableCode: true
|
||||
|
||||
var ANY: any;
|
||||
var BOOLEAN: boolean;
|
||||
var NUMBER: number;
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// @allowUnreachableCode: true
|
||||
|
||||
var ANY: any;
|
||||
var BOOLEAN: boolean;
|
||||
var NUMBER: number;
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// @allowUnreachableCode: true
|
||||
|
||||
var ANY: any;
|
||||
var BOOLEAN: boolean;
|
||||
var NUMBER: number;
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// @allowUnreachableCode: true
|
||||
|
||||
var ANY: any;
|
||||
var BOOLEAN: boolean;
|
||||
var NUMBER: number;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// @allowUnreachableCode: true
|
||||
|
||||
var ANY: any;
|
||||
var BOOLEAN: boolean;
|
||||
var NUMBER: number;
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// @allowUnreachableCode: true
|
||||
|
||||
// ~ operator on any type
|
||||
|
||||
var ANY: any;
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// @allowUnreachableCode: true
|
||||
|
||||
// ~ operator on boolean type
|
||||
var BOOLEAN: boolean;
|
||||
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// @allowUnreachableCode: true
|
||||
|
||||
// ~ operator on enum type
|
||||
|
||||
enum ENUM1 { A, B, "" };
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// @allowUnreachableCode: true
|
||||
|
||||
// ~ operator on number type
|
||||
var NUMBER: number;
|
||||
var NUMBER1: number[] = [1, 2];
|
||||
|
||||
+2
@@ -1,3 +1,5 @@
|
||||
// @allowUnreachableCode: true
|
||||
|
||||
// ~ operator on string type
|
||||
var STRING: string;
|
||||
var STRING1: string[] = ["", "abc"];
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// @allowUnreachableCode: true
|
||||
// @noImplicitAny: true
|
||||
|
||||
let x: (a: string) => string;
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// @allowUnreachableCode: true
|
||||
// @noImplicitAny: true
|
||||
|
||||
let x: (a: string) => string;
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// @allowUnreachableCode: true
|
||||
// @noImplicitAny: true
|
||||
|
||||
let x: (a: string) => string;
|
||||
|
||||
Reference in New Issue
Block a user