mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Baseline update
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(45,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
|
||||
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(46,27): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'.
|
||||
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(47,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
|
||||
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(57,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts (3 errors) ====
|
||||
==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts (4 errors) ====
|
||||
// ! operator on any type
|
||||
|
||||
var ANY: any;
|
||||
@@ -67,5 +68,7 @@ tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNot
|
||||
!ANY1;
|
||||
!ANY2[0];
|
||||
!ANY, ANY1;
|
||||
~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
!objA.a;
|
||||
!M.n;
|
||||
@@ -0,0 +1,44 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithBooleanType.ts(36,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithBooleanType.ts (1 errors) ====
|
||||
// ! operator on boolean type
|
||||
var BOOLEAN: boolean;
|
||||
|
||||
function foo(): boolean { return true; }
|
||||
|
||||
class A {
|
||||
public a: boolean;
|
||||
static foo() { return false; }
|
||||
}
|
||||
module M {
|
||||
export var n: boolean;
|
||||
}
|
||||
|
||||
var objA = new A();
|
||||
|
||||
// boolean type var
|
||||
var ResultIsBoolean1 = !BOOLEAN;
|
||||
|
||||
// boolean type literal
|
||||
var ResultIsBoolean2 = !true;
|
||||
var ResultIsBoolean3 = !{ x: true, y: false };
|
||||
|
||||
// boolean type expressions
|
||||
var ResultIsBoolean4 = !objA.a;
|
||||
var ResultIsBoolean5 = !M.n;
|
||||
var ResultIsBoolean6 = !foo();
|
||||
var ResultIsBoolean7 = !A.foo();
|
||||
|
||||
// multiple ! operators
|
||||
var ResultIsBoolean = !!BOOLEAN;
|
||||
|
||||
// miss assignment operators
|
||||
!true;
|
||||
!BOOLEAN;
|
||||
!foo();
|
||||
!true, false;
|
||||
~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
!objA.a;
|
||||
!M.n;
|
||||
@@ -0,0 +1,27 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithEnumType.ts(21,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithEnumType.ts (1 errors) ====
|
||||
// ! operator on enum type
|
||||
|
||||
enum ENUM { A, B, C };
|
||||
enum ENUM1 { };
|
||||
|
||||
// enum type var
|
||||
var ResultIsBoolean1 = !ENUM;
|
||||
|
||||
// enum type expressions
|
||||
var ResultIsBoolean2 = !ENUM["B"];
|
||||
var ResultIsBoolean3 = !(ENUM.B + ENUM["C"]);
|
||||
|
||||
// multiple ! operators
|
||||
var ResultIsBoolean4 = !!ENUM;
|
||||
var ResultIsBoolean5 = !!!(ENUM["B"] + ENUM.C);
|
||||
|
||||
// miss assignment operators
|
||||
!ENUM;
|
||||
!ENUM1;
|
||||
!ENUM.B;
|
||||
!ENUM, ENUM1;
|
||||
~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
@@ -0,0 +1,51 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithNumberType.ts(45,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithNumberType.ts (1 errors) ====
|
||||
// ! operator on number type
|
||||
var NUMBER: number;
|
||||
var NUMBER1: number[] = [1, 2];
|
||||
|
||||
function foo(): number { return 1; }
|
||||
|
||||
class A {
|
||||
public a: number;
|
||||
static foo() { return 1; }
|
||||
}
|
||||
module M {
|
||||
export var n: number;
|
||||
}
|
||||
|
||||
var objA = new A();
|
||||
|
||||
// number type var
|
||||
var ResultIsBoolean1 = !NUMBER;
|
||||
var ResultIsBoolean2 = !NUMBER1;
|
||||
|
||||
// number type literal
|
||||
var ResultIsBoolean3 = !1;
|
||||
var ResultIsBoolean4 = !{ x: 1, y: 2};
|
||||
var ResultIsBoolean5 = !{ x: 1, y: (n: number) => { return n; } };
|
||||
|
||||
// number type expressions
|
||||
var ResultIsBoolean6 = !objA.a;
|
||||
var ResultIsBoolean7 = !M.n;
|
||||
var ResultIsBoolean8 = !NUMBER1[0];
|
||||
var ResultIsBoolean9 = !foo();
|
||||
var ResultIsBoolean10 = !A.foo();
|
||||
var ResultIsBoolean11 = !(NUMBER + NUMBER);
|
||||
|
||||
// multiple ! operator
|
||||
var ResultIsBoolean12 = !!NUMBER;
|
||||
var ResultIsBoolean13 = !!!(NUMBER + NUMBER);
|
||||
|
||||
// miss assignment operators
|
||||
!1;
|
||||
!NUMBER;
|
||||
!NUMBER1;
|
||||
!foo();
|
||||
!objA.a;
|
||||
!M.n;
|
||||
!objA.a, M.n;
|
||||
~~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
@@ -0,0 +1,50 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithStringType.ts(44,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithStringType.ts (1 errors) ====
|
||||
// ! operator on string type
|
||||
var STRING: string;
|
||||
var STRING1: string[] = ["", "abc"];
|
||||
|
||||
function foo(): string { return "abc"; }
|
||||
|
||||
class A {
|
||||
public a: string;
|
||||
static foo() { return ""; }
|
||||
}
|
||||
module M {
|
||||
export var n: string;
|
||||
}
|
||||
|
||||
var objA = new A();
|
||||
|
||||
// string type var
|
||||
var ResultIsBoolean1 = !STRING;
|
||||
var ResultIsBoolean2 = !STRING1;
|
||||
|
||||
// string type literal
|
||||
var ResultIsBoolean3 = !"";
|
||||
var ResultIsBoolean4 = !{ x: "", y: "" };
|
||||
var ResultIsBoolean5 = !{ x: "", y: (s: string) => { return s; } };
|
||||
|
||||
// string type expressions
|
||||
var ResultIsBoolean6 = !objA.a;
|
||||
var ResultIsBoolean7 = !M.n;
|
||||
var ResultIsBoolean8 = !STRING1[0];
|
||||
var ResultIsBoolean9 = !foo();
|
||||
var ResultIsBoolean10 = !A.foo();
|
||||
var ResultIsBoolean11 = !(STRING + STRING);
|
||||
var ResultIsBoolean12 = !STRING.charAt(0);
|
||||
|
||||
// multiple ! operator
|
||||
var ResultIsBoolean13 = !!STRING;
|
||||
var ResultIsBoolean14 = !!!(STRING + STRING);
|
||||
|
||||
// miss assignment operators
|
||||
!"";
|
||||
!STRING;
|
||||
!STRING1;
|
||||
!foo();
|
||||
!objA.a,M.n;
|
||||
~~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
@@ -0,0 +1,59 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts(51,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts (1 errors) ====
|
||||
// - operator on any type
|
||||
|
||||
var ANY: any;
|
||||
var ANY1;
|
||||
var ANY2: any[] = ["", ""];
|
||||
var obj: () => {}
|
||||
var obj1 = { x: "", y: () => { }};
|
||||
|
||||
function foo(): any {
|
||||
var a;
|
||||
return a;
|
||||
}
|
||||
class A {
|
||||
public a: any;
|
||||
static foo() {
|
||||
var a;
|
||||
return a;
|
||||
}
|
||||
}
|
||||
module M {
|
||||
export var n: any;
|
||||
}
|
||||
var objA = new A();
|
||||
|
||||
// any type var
|
||||
var ResultIsNumber1 = -ANY1;
|
||||
var ResultIsNumber2 = -ANY2;
|
||||
var ResultIsNumber3 = -A;
|
||||
var ResultIsNumber4 = -M;
|
||||
var ResultIsNumber5 = -obj;
|
||||
var ResultIsNumber6 = -obj1;
|
||||
|
||||
// any type literal
|
||||
var ResultIsNumber7 = -undefined;
|
||||
var ResultIsNumber = -null;
|
||||
|
||||
// any type expressions
|
||||
var ResultIsNumber8 = -ANY2[0];
|
||||
var ResultIsNumber9 = -obj1.x;
|
||||
var ResultIsNumber10 = -obj1.y;
|
||||
var ResultIsNumber11 = -objA.a;
|
||||
var ResultIsNumber12 = -M.n;
|
||||
var ResultIsNumber13 = -foo();
|
||||
var ResultIsNumber14 = -A.foo();
|
||||
var ResultIsNumber15 = -(ANY - ANY1);
|
||||
|
||||
// miss assignment operators
|
||||
-ANY;
|
||||
-ANY1;
|
||||
-ANY2[0];
|
||||
-ANY, ANY1;
|
||||
~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
-objA.a;
|
||||
-M.n;
|
||||
@@ -0,0 +1,41 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithBooleanType.ts(33,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithBooleanType.ts (1 errors) ====
|
||||
// - operator on boolean type
|
||||
var BOOLEAN: boolean;
|
||||
|
||||
function foo(): boolean { return true; }
|
||||
|
||||
class A {
|
||||
public a: boolean;
|
||||
static foo() { return false; }
|
||||
}
|
||||
module M {
|
||||
export var n: boolean;
|
||||
}
|
||||
|
||||
var objA = new A();
|
||||
|
||||
// boolean type var
|
||||
var ResultIsNumber1 = -BOOLEAN;
|
||||
|
||||
// boolean type literal
|
||||
var ResultIsNumber2 = -true;
|
||||
var ResultIsNumber3 = -{ x: true, y: false };
|
||||
|
||||
// boolean type expressions
|
||||
var ResultIsNumber4 = -objA.a;
|
||||
var ResultIsNumber5 = -M.n;
|
||||
var ResultIsNumber6 = -foo();
|
||||
var ResultIsNumber7 = -A.foo();
|
||||
|
||||
// miss assignment operators
|
||||
-true;
|
||||
-BOOLEAN;
|
||||
-foo();
|
||||
-true, false;
|
||||
~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
-objA.a;
|
||||
-M.n;
|
||||
@@ -0,0 +1,23 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithEnumType.ts(17,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithEnumType.ts (1 errors) ====
|
||||
// - operator on enum type
|
||||
|
||||
enum ENUM { };
|
||||
enum ENUM1 { A, B, "" };
|
||||
|
||||
// enum type var
|
||||
var ResultIsNumber1 = -ENUM;
|
||||
|
||||
// expressions
|
||||
var ResultIsNumber2 = -ENUM1["B"];
|
||||
var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]);
|
||||
|
||||
// miss assignment operators
|
||||
-ENUM;
|
||||
-ENUM1;
|
||||
-ENUM1["B"];
|
||||
-ENUM, ENUM1;
|
||||
~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
@@ -0,0 +1,47 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithNumberType.ts(41,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithNumberType.ts (1 errors) ====
|
||||
// - operator on number type
|
||||
var NUMBER: number;
|
||||
var NUMBER1: number[] = [1, 2];
|
||||
|
||||
function foo(): number { return 1; }
|
||||
|
||||
class A {
|
||||
public a: number;
|
||||
static foo() { return 1; }
|
||||
}
|
||||
module M {
|
||||
export var n: number;
|
||||
}
|
||||
|
||||
var objA = new A();
|
||||
|
||||
// number type var
|
||||
var ResultIsNumber1 = -NUMBER;
|
||||
var ResultIsNumber2 = -NUMBER1;
|
||||
|
||||
// number type literal
|
||||
var ResultIsNumber3 = -1;
|
||||
var ResultIsNumber4 = -{ x: 1, y: 2};
|
||||
var ResultIsNumber5 = -{ x: 1, y: (n: number) => { return n; } };
|
||||
|
||||
// number type expressions
|
||||
var ResultIsNumber6 = -objA.a;
|
||||
var ResultIsNumber7 = -M.n;
|
||||
var ResultIsNumber8 = -NUMBER1[0];
|
||||
var ResultIsNumber9 = -foo();
|
||||
var ResultIsNumber10 = -A.foo();
|
||||
var ResultIsNumber11 = -(NUMBER - NUMBER);
|
||||
|
||||
// miss assignment operators
|
||||
-1;
|
||||
-NUMBER;
|
||||
-NUMBER1;
|
||||
-foo();
|
||||
-objA.a;
|
||||
-M.n;
|
||||
-objA.a, M.n;
|
||||
~~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
@@ -0,0 +1,46 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithStringType.ts(40,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithStringType.ts (1 errors) ====
|
||||
// - operator on string type
|
||||
var STRING: string;
|
||||
var STRING1: string[] = ["", "abc"];
|
||||
|
||||
function foo(): string { return "abc"; }
|
||||
|
||||
class A {
|
||||
public a: string;
|
||||
static foo() { return ""; }
|
||||
}
|
||||
module M {
|
||||
export var n: string;
|
||||
}
|
||||
|
||||
var objA = new A();
|
||||
|
||||
// string type var
|
||||
var ResultIsNumber1 = -STRING;
|
||||
var ResultIsNumber2 = -STRING1;
|
||||
|
||||
// string type literal
|
||||
var ResultIsNumber3 = -"";
|
||||
var ResultIsNumber4 = -{ x: "", y: "" };
|
||||
var ResultIsNumber5 = -{ x: "", y: (s: string) => { return s; } };
|
||||
|
||||
// string type expressions
|
||||
var ResultIsNumber6 = -objA.a;
|
||||
var ResultIsNumber7 = -M.n;
|
||||
var ResultIsNumber8 = -STRING1[0];
|
||||
var ResultIsNumber9 = -foo();
|
||||
var ResultIsNumber10 = -A.foo();
|
||||
var ResultIsNumber11 = -(STRING + STRING);
|
||||
var ResultIsNumber12 = -STRING.charAt(0);
|
||||
|
||||
// miss assignment operators
|
||||
-"";
|
||||
-STRING;
|
||||
-STRING1;
|
||||
-foo();
|
||||
-objA.a,M.n;
|
||||
~~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
@@ -1,9 +1,10 @@
|
||||
tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(27,16): error TS1005: ',' expected.
|
||||
tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(27,16): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(32,23): error TS1005: '(' expected.
|
||||
tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(37,9): error TS2350: Only a void function can be called with the 'new' keyword.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts (3 errors) ====
|
||||
==== tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts (4 errors) ====
|
||||
|
||||
class C0 {
|
||||
|
||||
@@ -33,6 +34,8 @@ tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(37,9):
|
||||
var b = new C0 32, ''; // Parse error
|
||||
~~
|
||||
!!! error TS1005: ',' expected.
|
||||
~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
// Generic construct expression with no parentheses
|
||||
var c1 = new T;
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(28,32): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(28,56): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(29,33): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(29,57): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts (4 errors) ====
|
||||
|
||||
function fun<T>(g: (x: T) => T, x: T): T;
|
||||
function fun<T>(g: (x: T) => T, h: (y: T) => T, x: T): T;
|
||||
function fun<T>(g: (x: T) => T, x: T): T {
|
||||
return g(x);
|
||||
}
|
||||
|
||||
var a = fun(x => x, 10);
|
||||
var b = fun((x => x), 10);
|
||||
var c = fun(((x => x)), 10);
|
||||
var d = fun((((x => x))), 10);
|
||||
|
||||
var e = fun(x => x, x => x, 10);
|
||||
var f = fun((x => x), (x => x), 10);
|
||||
var g = fun(((x => x)), ((x => x)), 10);
|
||||
var h = fun((((x => x))), ((x => x)), 10);
|
||||
|
||||
// Ternaries in parens
|
||||
var i = fun((Math.random() < 0.5 ? x => x : x => undefined), 10);
|
||||
var j = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), 10);
|
||||
var k = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), x => x, 10);
|
||||
var l = fun(((Math.random() < 0.5 ? ((x => x)) : ((x => undefined)))), ((x => x)), 10);
|
||||
|
||||
var lambda1: (x: number) => number = x => x;
|
||||
var lambda2: (x: number) => number = (x => x);
|
||||
|
||||
type ObjType = { x: (p: number) => string; y: (p: string) => number };
|
||||
var obj1: ObjType = { x: x => (x, undefined), y: y => (y, undefined) };
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
var obj2: ObjType = ({ x: x => (x, undefined), y: y => (y, undefined) });
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
@@ -0,0 +1,51 @@
|
||||
tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(35,32): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(35,56): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(36,33): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(36,57): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts (4 errors) ====
|
||||
// These tests ensure that in cases where it may *appear* that a value has a type,
|
||||
// they actually are properly being contextually typed. The way we test this is
|
||||
// that we invoke contextually typed arguments with type arguments.
|
||||
// Since 'any' cannot be invoked with type arguments, we should get errors
|
||||
// back if contextual typing is not taking effect.
|
||||
|
||||
type FuncType = (x: <T>(p: T) => T) => typeof x;
|
||||
|
||||
function fun<T>(f: FuncType, x: T): T;
|
||||
function fun<T>(f: FuncType, g: FuncType, x: T): T;
|
||||
function fun<T>(...rest: any[]): T {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
var a = fun(x => { x<number>(undefined); return x; }, 10);
|
||||
var b = fun((x => { x<number>(undefined); return x; }), 10);
|
||||
var c = fun(((x => { x<number>(undefined); return x; })), 10);
|
||||
var d = fun((((x => { x<number>(undefined); return x; }))), 10);
|
||||
|
||||
var e = fun(x => { x<number>(undefined); return x; }, x => { x<number>(undefined); return x; }, 10);
|
||||
var f = fun((x => { x<number>(undefined); return x; }),(x => { x<number>(undefined); return x; }), 10);
|
||||
var g = fun(((x => { x<number>(undefined); return x; })),((x => { x<number>(undefined); return x; })), 10);
|
||||
var h = fun((((x => { x<number>(undefined); return x; }))),((x => { x<number>(undefined); return x; })), 10);
|
||||
|
||||
// Ternaries in parens
|
||||
var i = fun((Math.random() < 0.5 ? x => { x<number>(undefined); return x; } : x => undefined), 10);
|
||||
var j = fun((Math.random() < 0.5 ? (x => { x<number>(undefined); return x; }) : (x => undefined)), 10);
|
||||
var k = fun((Math.random() < 0.5 ? (x => { x<number>(undefined); return x; }) : (x => undefined)), x => { x<number>(undefined); return x; }, 10);
|
||||
var l = fun(((Math.random() < 0.5 ? ((x => { x<number>(undefined); return x; })) : ((x => undefined)))),((x => { x<number>(undefined); return x; })), 10);
|
||||
|
||||
var lambda1: FuncType = x => { x<number>(undefined); return x; };
|
||||
var lambda2: FuncType = (x => { x<number>(undefined); return x; });
|
||||
|
||||
type ObjType = { x: (p: number) => string; y: (p: string) => number };
|
||||
var obj1: ObjType = { x: x => (x, undefined), y: y => (y, undefined) };
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
var obj2: ObjType = ({ x: x => (x, undefined), y: y => (y, undefined) });
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
@@ -1,5 +1,7 @@
|
||||
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,11): error TS2304: Cannot find name 'a'.
|
||||
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,11): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,15): error TS2304: Cannot find name 'b'.
|
||||
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,15): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,18): error TS2304: Cannot find name 'c'.
|
||||
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,22): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,25): error TS2304: Cannot find name 'a'.
|
||||
@@ -7,12 +9,16 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,27)
|
||||
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,29): error TS2304: Cannot find name 'c'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts (7 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts (9 errors) ====
|
||||
var tt = (a, (b, c)) => a+b+c;
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'a'.
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'b'.
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'c'.
|
||||
~~
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts(1,1): error TS2304: Cannot find name 'a'.
|
||||
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts(1,6): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts(1,17): error TS2304: Cannot find name 'a'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts (2 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts (3 errors) ====
|
||||
a = (() => { }, a)
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'a'.
|
||||
~~~~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'a'.
|
||||
@@ -7,13 +7,14 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunctio
|
||||
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(8,13): error TS2304: Cannot find name 'a'.
|
||||
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(9,10): error TS2304: Cannot find name 'T'.
|
||||
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(9,13): error TS2304: Cannot find name 'a'.
|
||||
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(9,13): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(9,16): error TS2304: Cannot find name 'b'.
|
||||
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(10,10): error TS2304: Cannot find name 'T'.
|
||||
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(10,13): error TS2304: Cannot find name 'a'.
|
||||
tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(10,20): error TS2304: Cannot find name 'b'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts (13 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts (14 errors) ====
|
||||
var v = <T>() => 1;
|
||||
var v = <T>a;
|
||||
~
|
||||
@@ -41,6 +42,8 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunctio
|
||||
!!! error TS2304: Cannot find name 'T'.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'a'.
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'b'.
|
||||
var v = <T>(a = 1, b = 2);
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts(2,6): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts(2,6): error TS1171: A comma expression is not allowed in a computed property name.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts (1 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts (2 errors) ====
|
||||
var x = {
|
||||
[0, 1]: { }
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~~~~
|
||||
!!! error TS1171: A comma expression is not allowed in a computed property name.
|
||||
}
|
||||
@@ -1,12 +1,18 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts(2,54): error TS1005: ',' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts(2,56): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts(2,56): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts(2,105): error TS1005: ';' expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts (2 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts (4 errors) ====
|
||||
|
||||
var texCoords = [2, 2, 0.5000001192092895, 0.8749999 ; 403953552, 0.5000001192092895, 0.8749999403953552];
|
||||
~
|
||||
!!! error TS1005: ',' expected.
|
||||
~~~~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts(1,1): error TS2304: Cannot find name 'b'.
|
||||
tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts(1,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts(1,16): error TS2304: Cannot find name 'c'.
|
||||
tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts(1,21): error TS2304: Cannot find name 'd'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts (3 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts (4 errors) ====
|
||||
b.src ? 1 : 2, c && d;
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'b'.
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'c'.
|
||||
~
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(46,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
|
||||
tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(47,26): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'.
|
||||
tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(48,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
|
||||
tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(54,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts (3 errors) ====
|
||||
==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts (4 errors) ====
|
||||
// + operator on any type
|
||||
|
||||
var ANY: any;
|
||||
@@ -64,5 +65,7 @@ tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWith
|
||||
+ANY1;
|
||||
+ANY2[0];
|
||||
+ANY, ANY1;
|
||||
~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
+objA.a;
|
||||
+M.n;
|
||||
@@ -0,0 +1,41 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithBooleanType.ts(33,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithBooleanType.ts (1 errors) ====
|
||||
// + operator on boolean type
|
||||
var BOOLEAN: boolean;
|
||||
|
||||
function foo(): boolean { return true; }
|
||||
|
||||
class A {
|
||||
public a: boolean;
|
||||
static foo() { return false; }
|
||||
}
|
||||
module M {
|
||||
export var n: boolean;
|
||||
}
|
||||
|
||||
var objA = new A();
|
||||
|
||||
// boolean type var
|
||||
var ResultIsNumber1 = +BOOLEAN;
|
||||
|
||||
// boolean type literal
|
||||
var ResultIsNumber2 = +true;
|
||||
var ResultIsNumber3 = +{ x: true, y: false };
|
||||
|
||||
// boolean type expressions
|
||||
var ResultIsNumber4 = +objA.a;
|
||||
var ResultIsNumber5 = +M.n;
|
||||
var ResultIsNumber6 = +foo();
|
||||
var ResultIsNumber7 = +A.foo();
|
||||
|
||||
// miss assignment operators
|
||||
+true;
|
||||
+BOOLEAN;
|
||||
+foo();
|
||||
+true, false;
|
||||
~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
+objA.a;
|
||||
+M.n;
|
||||
@@ -0,0 +1,24 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithEnumType.ts(18,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithEnumType.ts (1 errors) ====
|
||||
// + operator on enum type
|
||||
|
||||
enum ENUM { };
|
||||
enum ENUM1 { A, B, "" };
|
||||
|
||||
// enum type var
|
||||
var ResultIsNumber1 = +ENUM;
|
||||
var ResultIsNumber2 = +ENUM1;
|
||||
|
||||
// enum type expressions
|
||||
var ResultIsNumber3 = +ENUM1["A"];
|
||||
var ResultIsNumber4 = +(ENUM[0] + ENUM1["B"]);
|
||||
|
||||
// miss assignment operators
|
||||
+ENUM;
|
||||
+ENUM1;
|
||||
+ENUM1.B;
|
||||
+ENUM, ENUM1;
|
||||
~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
@@ -0,0 +1,47 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithNumberType.ts(41,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithNumberType.ts (1 errors) ====
|
||||
// + operator on number type
|
||||
var NUMBER: number;
|
||||
var NUMBER1: number[] = [1, 2];
|
||||
|
||||
function foo(): number { return 1; }
|
||||
|
||||
class A {
|
||||
public a: number;
|
||||
static foo() { return 1; }
|
||||
}
|
||||
module M {
|
||||
export var n: number;
|
||||
}
|
||||
|
||||
var objA = new A();
|
||||
|
||||
// number type var
|
||||
var ResultIsNumber1 = +NUMBER;
|
||||
var ResultIsNumber2 = +NUMBER1;
|
||||
|
||||
// number type literal
|
||||
var ResultIsNumber3 = +1;
|
||||
var ResultIsNumber4 = +{ x: 1, y: 2};
|
||||
var ResultIsNumber5 = +{ x: 1, y: (n: number) => { return n; } };
|
||||
|
||||
// number type expressions
|
||||
var ResultIsNumber6 = +objA.a;
|
||||
var ResultIsNumber7 = +M.n;
|
||||
var ResultIsNumber8 = +NUMBER1[0];
|
||||
var ResultIsNumber9 = +foo();
|
||||
var ResultIsNumber10 = +A.foo();
|
||||
var ResultIsNumber11 = +(NUMBER + NUMBER);
|
||||
|
||||
// miss assignment operators
|
||||
+1;
|
||||
+NUMBER;
|
||||
+NUMBER1;
|
||||
+foo();
|
||||
+objA.a;
|
||||
+M.n;
|
||||
+objA.a, M.n;
|
||||
~~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
@@ -0,0 +1,46 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithStringType.ts(40,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithStringType.ts (1 errors) ====
|
||||
// + operator on string type
|
||||
var STRING: string;
|
||||
var STRING1: string[] = ["", "abc"];
|
||||
|
||||
function foo(): string { return "abc"; }
|
||||
|
||||
class A {
|
||||
public a: string;
|
||||
static foo() { return ""; }
|
||||
}
|
||||
module M {
|
||||
export var n: string;
|
||||
}
|
||||
|
||||
var objA = new A();
|
||||
|
||||
// string type var
|
||||
var ResultIsNumber1 = +STRING;
|
||||
var ResultIsNumber2 = +STRING1;
|
||||
|
||||
// string type literal
|
||||
var ResultIsNumber3 = +"";
|
||||
var ResultIsNumber4 = +{ x: "", y: "" };
|
||||
var ResultIsNumber5 = +{ x: "", y: (s: string) => { return s; } };
|
||||
|
||||
// string type expressions
|
||||
var ResultIsNumber6 = +objA.a;
|
||||
var ResultIsNumber7 = +M.n;
|
||||
var ResultIsNumber8 = +STRING1[0];
|
||||
var ResultIsNumber9 = +foo();
|
||||
var ResultIsNumber10 = +A.foo();
|
||||
var ResultIsNumber11 = +(STRING + STRING);
|
||||
var ResultIsNumber12 = +STRING.charAt(0);
|
||||
|
||||
// miss assignment operators
|
||||
+"";
|
||||
+STRING;
|
||||
+STRING1;
|
||||
+foo();
|
||||
+objA.a,M.n;
|
||||
~~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
@@ -1,9 +1,10 @@
|
||||
tests/cases/compiler/sourceMapValidationFor.ts(2,5): error TS2304: Cannot find name 'WScript'.
|
||||
tests/cases/compiler/sourceMapValidationFor.ts(6,5): error TS2304: Cannot find name 'WScript'.
|
||||
tests/cases/compiler/sourceMapValidationFor.ts(20,1): error TS7027: Unreachable code detected.
|
||||
tests/cases/compiler/sourceMapValidationFor.ts(32,21): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/compiler/sourceMapValidationFor.ts (3 errors) ====
|
||||
==== tests/cases/compiler/sourceMapValidationFor.ts (4 errors) ====
|
||||
for (var i = 0; i < 10; i++) {
|
||||
WScript.Echo("i: " + i);
|
||||
~~~~~~~
|
||||
@@ -42,4 +43,6 @@ tests/cases/compiler/sourceMapValidationFor.ts(20,1): error TS7027: Unreachable
|
||||
i++;
|
||||
}
|
||||
for (i = 0, j = 20; j < 20, i < 20; j++) {
|
||||
~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
}
|
||||
@@ -2,6 +2,8 @@ tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(10
|
||||
Type '"baz"' is not comparable to type '"foo"'.
|
||||
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(12,10): error TS2678: Type '"bar"' is not comparable to type '"foo"'.
|
||||
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(14,10): error TS2678: Type '"baz"' is not comparable to type '"foo"'.
|
||||
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(14,11): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(14,11): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(20,10): error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'.
|
||||
Type '"baz"' is not comparable to type '"foo"'.
|
||||
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(22,10): error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'.
|
||||
@@ -10,7 +12,7 @@ tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(23
|
||||
Type '"baz"' is not comparable to type '"foo"'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts (6 errors) ====
|
||||
==== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts (8 errors) ====
|
||||
let x: "foo";
|
||||
let y: "foo" | "bar";
|
||||
let z: "bar";
|
||||
@@ -32,6 +34,10 @@ tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(23
|
||||
case (x, y, ("baz")):
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2678: Type '"baz"' is not comparable to type '"foo"'.
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
x;
|
||||
y;
|
||||
break;
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(7,10): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(9,10): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(11,10): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(11,10): error TS2678: Type '"baz"' is not comparable to type '"foo" | "bar"'.
|
||||
tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(13,10): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts (1 errors) ====
|
||||
==== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts (5 errors) ====
|
||||
let x: "foo";
|
||||
let y: "foo" | "bar";
|
||||
|
||||
@@ -9,14 +13,22 @@ tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(11
|
||||
|
||||
switch (y) {
|
||||
case "foo", x:
|
||||
~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
break;
|
||||
case x, "foo":
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
break;
|
||||
case x, "baz":
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~~~~~~~~
|
||||
!!! error TS2678: Type '"baz"' is not comparable to type '"foo" | "bar"'.
|
||||
break;
|
||||
case "baz", x:
|
||||
~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
break;
|
||||
case "baz" && "bar":
|
||||
break;
|
||||
|
||||
@@ -4,9 +4,13 @@ tests/cases/compiler/systemModule16.ts(4,15): error TS2307: Cannot find module '
|
||||
tests/cases/compiler/systemModule16.ts(5,15): error TS2307: Cannot find module 'bar'.
|
||||
tests/cases/compiler/systemModule16.ts(8,32): error TS2307: Cannot find module 'foo'.
|
||||
tests/cases/compiler/systemModule16.ts(9,32): error TS2307: Cannot find module 'bar'.
|
||||
tests/cases/compiler/systemModule16.ts(11,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/compiler/systemModule16.ts(11,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/compiler/systemModule16.ts(11,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/compiler/systemModule16.ts(11,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/compiler/systemModule16.ts (6 errors) ====
|
||||
==== tests/cases/compiler/systemModule16.ts (10 errors) ====
|
||||
|
||||
import * as x from "foo";
|
||||
~~~~~
|
||||
@@ -30,4 +34,12 @@ tests/cases/compiler/systemModule16.ts(9,32): error TS2307: Cannot find module '
|
||||
!!! error TS2307: Cannot find module 'bar'.
|
||||
|
||||
x,y,a1,b1,d1;
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~~~~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
tests/cases/conformance/jsx/file.tsx(19,2): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/jsx/file.tsx(23,3): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/jsx/file.tsx(26,3): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/jsx/file.tsx(39,2): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/jsx/file.tsx (4 errors) ====
|
||||
|
||||
declare module JSX {
|
||||
interface Element { }
|
||||
interface IntrinsicElements { }
|
||||
}
|
||||
|
||||
module M {
|
||||
export class Foo { constructor() { } }
|
||||
export module S {
|
||||
export class Bar { }
|
||||
|
||||
// Emit Foo
|
||||
// Foo, <Foo />;
|
||||
}
|
||||
}
|
||||
|
||||
module M {
|
||||
// Emit M.Foo
|
||||
Foo, <Foo />;
|
||||
~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
export module S {
|
||||
// Emit M.Foo
|
||||
Foo, <Foo />;
|
||||
~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
// Emit S.Bar
|
||||
Bar, <Bar />;
|
||||
~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module M {
|
||||
// Emit M.S.Bar
|
||||
S.Bar, <S.Bar />;
|
||||
}
|
||||
|
||||
module M {
|
||||
var M = 100;
|
||||
// Emit M_1.Foo
|
||||
Foo, <Foo />;
|
||||
~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
}
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
tests/cases/compiler/typecheckCommaExpression.ts(1,2): error TS2304: Cannot find name 'a'.
|
||||
tests/cases/compiler/typecheckCommaExpression.ts(1,2): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/compiler/typecheckCommaExpression.ts(1,5): error TS2304: Cannot find name 'b'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/typecheckCommaExpression.ts (2 errors) ====
|
||||
==== tests/cases/compiler/typecheckCommaExpression.ts (3 errors) ====
|
||||
(a, b)
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'a'.
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'b'.
|
||||
@@ -1,6 +1,7 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(46,32): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
|
||||
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(47,32): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'.
|
||||
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(48,32): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
|
||||
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(58,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(68,1): error TS7028: Unused label.
|
||||
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(69,1): error TS7028: Unused label.
|
||||
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(70,1): error TS7028: Unused label.
|
||||
@@ -10,7 +11,7 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator
|
||||
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(74,1): error TS7028: Unused label.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts (10 errors) ====
|
||||
==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts (11 errors) ====
|
||||
// typeof operator on any type
|
||||
|
||||
var ANY: any;
|
||||
@@ -75,6 +76,8 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator
|
||||
typeof ANY1;
|
||||
typeof ANY2[0];
|
||||
typeof ANY, ANY1;
|
||||
~~~~~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
typeof obj1;
|
||||
typeof obj1.x;
|
||||
typeof objA.a;
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts(37,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts (1 errors) ====
|
||||
|
||||
// typeof operator on boolean type
|
||||
var BOOLEAN: boolean;
|
||||
|
||||
function foo(): boolean { return true; }
|
||||
|
||||
class A {
|
||||
public a: boolean;
|
||||
static foo() { return false; }
|
||||
}
|
||||
module M {
|
||||
export var n: boolean;
|
||||
}
|
||||
|
||||
var objA = new A();
|
||||
|
||||
// boolean type var
|
||||
var ResultIsString1 = typeof BOOLEAN;
|
||||
|
||||
// boolean type literal
|
||||
var ResultIsString2 = typeof true;
|
||||
var ResultIsString3 = typeof { x: true, y: false };
|
||||
|
||||
// boolean type expressions
|
||||
var ResultIsString4 = typeof objA.a;
|
||||
var ResultIsString5 = typeof M.n;
|
||||
var ResultIsString6 = typeof foo();
|
||||
var ResultIsString7 = typeof A.foo();
|
||||
|
||||
// multiple typeof operator
|
||||
var ResultIsString8 = typeof typeof BOOLEAN;
|
||||
|
||||
// miss assignment operators
|
||||
typeof true;
|
||||
typeof BOOLEAN;
|
||||
typeof foo();
|
||||
typeof true, false;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
typeof objA.a;
|
||||
typeof M.n;
|
||||
|
||||
// use typeof in type query
|
||||
var z: boolean;
|
||||
var x: boolean[];
|
||||
var r: () => boolean;
|
||||
z: typeof BOOLEAN;
|
||||
r: typeof foo;
|
||||
var y = { a: true, b: false};
|
||||
z: typeof y.a;
|
||||
z: typeof objA.a;
|
||||
z: typeof A.foo;
|
||||
z: typeof M.n;
|
||||
@@ -0,0 +1,34 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts(23,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts (1 errors) ====
|
||||
|
||||
// typeof operator on enum type
|
||||
|
||||
enum ENUM { };
|
||||
enum ENUM1 { A, B, "" };
|
||||
|
||||
// enum type var
|
||||
var ResultIsString1 = typeof ENUM;
|
||||
var ResultIsString2 = typeof ENUM1;
|
||||
|
||||
// enum type expressions
|
||||
var ResultIsString3 = typeof ENUM1["A"];
|
||||
var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]);
|
||||
|
||||
// multiple typeof operators
|
||||
var ResultIsString5 = typeof typeof ENUM;
|
||||
var ResultIsString6 = typeof typeof typeof (ENUM[0] + ENUM1.B);
|
||||
|
||||
// miss assignment operators
|
||||
typeof ENUM;
|
||||
typeof ENUM1;
|
||||
typeof ENUM1["B"];
|
||||
typeof ENUM, ENUM1;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
// use typeof in type query
|
||||
enum z { };
|
||||
z: typeof ENUM;
|
||||
z: typeof ENUM1;
|
||||
@@ -0,0 +1,63 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts(45,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts (1 errors) ====
|
||||
// typeof operator on number type
|
||||
var NUMBER: number;
|
||||
var NUMBER1: number[] = [1, 2];
|
||||
|
||||
function foo(): number { return 1; }
|
||||
|
||||
class A {
|
||||
public a: number;
|
||||
static foo() { return 1; }
|
||||
}
|
||||
module M {
|
||||
export var n: number;
|
||||
}
|
||||
|
||||
var objA = new A();
|
||||
|
||||
// number type var
|
||||
var ResultIsString1 = typeof NUMBER;
|
||||
var ResultIsString2 = typeof NUMBER1;
|
||||
|
||||
// number type literal
|
||||
var ResultIsString3 = typeof 1;
|
||||
var ResultIsString4 = typeof { x: 1, y: 2};
|
||||
var ResultIsString5 = typeof { x: 1, y: (n: number) => { return n; } };
|
||||
|
||||
// number type expressions
|
||||
var ResultIsString6 = typeof objA.a;
|
||||
var ResultIsString7 = typeof M.n;
|
||||
var ResultIsString8 = typeof NUMBER1[0];
|
||||
var ResultIsString9 = typeof foo();
|
||||
var ResultIsString10 = typeof A.foo();
|
||||
var ResultIsString11 = typeof (NUMBER + NUMBER);
|
||||
|
||||
// multiple typeof operators
|
||||
var ResultIsString12 = typeof typeof NUMBER;
|
||||
var ResultIsString13 = typeof typeof typeof (NUMBER + NUMBER);
|
||||
|
||||
// miss assignment operators
|
||||
typeof 1;
|
||||
typeof NUMBER;
|
||||
typeof NUMBER1;
|
||||
typeof foo();
|
||||
typeof objA.a;
|
||||
typeof M.n;
|
||||
typeof objA.a, M.n;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
// use typeof in type query
|
||||
var z: number;
|
||||
var x: number[];
|
||||
z: typeof NUMBER;
|
||||
x: typeof NUMBER1;
|
||||
r: typeof foo;
|
||||
var y = { a: 1, b: 2 };
|
||||
z: typeof y.a;
|
||||
z: typeof objA.a;
|
||||
z: typeof A.foo;
|
||||
z: typeof M.n;
|
||||
@@ -1,3 +1,4 @@
|
||||
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(44,1): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(50,1): error TS7028: Unused label.
|
||||
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(51,1): error TS7028: Unused label.
|
||||
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(52,1): error TS7028: Unused label.
|
||||
@@ -7,7 +8,7 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator
|
||||
tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(57,1): error TS7028: Unused label.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts (7 errors) ====
|
||||
==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts (8 errors) ====
|
||||
// typeof operator on string type
|
||||
var STRING: string;
|
||||
var STRING1: string[] = ["", "abc"];
|
||||
@@ -52,6 +53,8 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator
|
||||
typeof STRING1;
|
||||
typeof foo();
|
||||
typeof objA.a, M.n;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
|
||||
// use typeof in type query
|
||||
var z: string;
|
||||
|
||||
@@ -2,6 +2,7 @@ tests/cases/compiler/widenedTypes.ts(2,1): error TS2358: The left-hand side of a
|
||||
tests/cases/compiler/widenedTypes.ts(5,1): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'.
|
||||
tests/cases/compiler/widenedTypes.ts(6,7): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter
|
||||
tests/cases/compiler/widenedTypes.ts(8,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
|
||||
tests/cases/compiler/widenedTypes.ts(10,14): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/compiler/widenedTypes.ts(11,1): error TS2322: Type '""' is not assignable to type 'number'.
|
||||
tests/cases/compiler/widenedTypes.ts(18,1): error TS2322: Type '""' is not assignable to type 'number'.
|
||||
tests/cases/compiler/widenedTypes.ts(23,5): error TS2322: Type 'number[]' is not assignable to type 'string[]'.
|
||||
@@ -11,7 +12,7 @@ tests/cases/compiler/widenedTypes.ts(24,5): error TS2322: Type '{ x: number; y:
|
||||
Type 'number' is not assignable to type 'string'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/widenedTypes.ts (8 errors) ====
|
||||
==== tests/cases/compiler/widenedTypes.ts (9 errors) ====
|
||||
|
||||
null instanceof (() => { });
|
||||
~~~~
|
||||
@@ -30,6 +31,8 @@ tests/cases/compiler/widenedTypes.ts(24,5): error TS2322: Type '{ x: number; y:
|
||||
!!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter.
|
||||
|
||||
var t = [3, (3, null)];
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
t[3] = "";
|
||||
~~~~
|
||||
!!! error TS2322: Type '""' is not assignable to type 'number'.
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
tests/cases/conformance/types/witness/witness.ts(8,21): error TS2372: Parameter 'pInit' cannot be referenced in its initializer.
|
||||
tests/cases/conformance/types/witness/witness.ts(32,12): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/types/witness/witness.ts(33,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'co1' must be of type 'any', but here has type 'number'.
|
||||
tests/cases/conformance/types/witness/witness.ts(34,12): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/types/witness/witness.ts(34,12): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/types/witness/witness.ts(36,12): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/types/witness/witness.ts(36,12): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/types/witness/witness.ts(36,12): error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
tests/cases/conformance/types/witness/witness.ts(37,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'co3' must be of type 'any', but here has type 'number'.
|
||||
tests/cases/conformance/types/witness/witness.ts(41,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'as1' must be of type 'any', but here has type 'number'.
|
||||
tests/cases/conformance/types/witness/witness.ts(43,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'as2' must be of type 'any', but here has type 'number'.
|
||||
@@ -8,7 +14,7 @@ tests/cases/conformance/types/witness/witness.ts(61,5): error TS2403: Subsequent
|
||||
tests/cases/conformance/types/witness/witness.ts(114,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'propAcc1' must be of type 'any', but here has type '{ m: any; }'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/witness/witness.ts (8 errors) ====
|
||||
==== tests/cases/conformance/types/witness/witness.ts (14 errors) ====
|
||||
|
||||
|
||||
|
||||
@@ -43,12 +49,24 @@ tests/cases/conformance/types/witness/witness.ts(114,5): error TS2403: Subsequen
|
||||
|
||||
// Comma
|
||||
var co1 = (co1, 3);
|
||||
~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
var co1: number;
|
||||
~~~
|
||||
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'co1' must be of type 'any', but here has type 'number'.
|
||||
var co2 = (3, 4, co2);
|
||||
~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
var co2: any;
|
||||
var co3 = (co1, co2, co3, co1);
|
||||
~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~~~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2693: Left side of comma operator is unused and has no side effects.
|
||||
var co3: number;
|
||||
~~~
|
||||
!!! error TS2403: Subsequent variable declarations must have the same type. Variable 'co3' must be of type 'any', but here has type 'number'.
|
||||
|
||||
Reference in New Issue
Block a user