Skip to content

Commit 509de27

Browse files
committed
Baseline update
1 parent add7c1a commit 509de27

File tree

37 files changed

+965
-18
lines changed

37 files changed

+965
-18
lines changed

tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(45,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
22
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(46,27): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'.
33
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(47,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'.
4+
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(57,1): error TS2693: Left side of comma operator is unused and has no side effects.
45

56

6-
==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts (3 errors) ====
7+
==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts (4 errors) ====
78
// ! operator on any type
89

910
var ANY: any;
@@ -67,5 +68,7 @@ tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNot
6768
!ANY1;
6869
!ANY2[0];
6970
!ANY, ANY1;
71+
~~~~
72+
!!! error TS2693: Left side of comma operator is unused and has no side effects.
7073
!objA.a;
7174
!M.n;
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithBooleanType.ts(36,1): error TS2693: Left side of comma operator is unused and has no side effects.
2+
3+
4+
==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithBooleanType.ts (1 errors) ====
5+
// ! operator on boolean type
6+
var BOOLEAN: boolean;
7+
8+
function foo(): boolean { return true; }
9+
10+
class A {
11+
public a: boolean;
12+
static foo() { return false; }
13+
}
14+
module M {
15+
export var n: boolean;
16+
}
17+
18+
var objA = new A();
19+
20+
// boolean type var
21+
var ResultIsBoolean1 = !BOOLEAN;
22+
23+
// boolean type literal
24+
var ResultIsBoolean2 = !true;
25+
var ResultIsBoolean3 = !{ x: true, y: false };
26+
27+
// boolean type expressions
28+
var ResultIsBoolean4 = !objA.a;
29+
var ResultIsBoolean5 = !M.n;
30+
var ResultIsBoolean6 = !foo();
31+
var ResultIsBoolean7 = !A.foo();
32+
33+
// multiple ! operators
34+
var ResultIsBoolean = !!BOOLEAN;
35+
36+
// miss assignment operators
37+
!true;
38+
!BOOLEAN;
39+
!foo();
40+
!true, false;
41+
~~~~~
42+
!!! error TS2693: Left side of comma operator is unused and has no side effects.
43+
!objA.a;
44+
!M.n;
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithEnumType.ts(21,1): error TS2693: Left side of comma operator is unused and has no side effects.
2+
3+
4+
==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithEnumType.ts (1 errors) ====
5+
// ! operator on enum type
6+
7+
enum ENUM { A, B, C };
8+
enum ENUM1 { };
9+
10+
// enum type var
11+
var ResultIsBoolean1 = !ENUM;
12+
13+
// enum type expressions
14+
var ResultIsBoolean2 = !ENUM["B"];
15+
var ResultIsBoolean3 = !(ENUM.B + ENUM["C"]);
16+
17+
// multiple ! operators
18+
var ResultIsBoolean4 = !!ENUM;
19+
var ResultIsBoolean5 = !!!(ENUM["B"] + ENUM.C);
20+
21+
// miss assignment operators
22+
!ENUM;
23+
!ENUM1;
24+
!ENUM.B;
25+
!ENUM, ENUM1;
26+
~~~~~
27+
!!! error TS2693: Left side of comma operator is unused and has no side effects.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithNumberType.ts(45,1): error TS2693: Left side of comma operator is unused and has no side effects.
2+
3+
4+
==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithNumberType.ts (1 errors) ====
5+
// ! operator on number type
6+
var NUMBER: number;
7+
var NUMBER1: number[] = [1, 2];
8+
9+
function foo(): number { return 1; }
10+
11+
class A {
12+
public a: number;
13+
static foo() { return 1; }
14+
}
15+
module M {
16+
export var n: number;
17+
}
18+
19+
var objA = new A();
20+
21+
// number type var
22+
var ResultIsBoolean1 = !NUMBER;
23+
var ResultIsBoolean2 = !NUMBER1;
24+
25+
// number type literal
26+
var ResultIsBoolean3 = !1;
27+
var ResultIsBoolean4 = !{ x: 1, y: 2};
28+
var ResultIsBoolean5 = !{ x: 1, y: (n: number) => { return n; } };
29+
30+
// number type expressions
31+
var ResultIsBoolean6 = !objA.a;
32+
var ResultIsBoolean7 = !M.n;
33+
var ResultIsBoolean8 = !NUMBER1[0];
34+
var ResultIsBoolean9 = !foo();
35+
var ResultIsBoolean10 = !A.foo();
36+
var ResultIsBoolean11 = !(NUMBER + NUMBER);
37+
38+
// multiple ! operator
39+
var ResultIsBoolean12 = !!NUMBER;
40+
var ResultIsBoolean13 = !!!(NUMBER + NUMBER);
41+
42+
// miss assignment operators
43+
!1;
44+
!NUMBER;
45+
!NUMBER1;
46+
!foo();
47+
!objA.a;
48+
!M.n;
49+
!objA.a, M.n;
50+
~~~~~~~
51+
!!! error TS2693: Left side of comma operator is unused and has no side effects.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithStringType.ts(44,1): error TS2693: Left side of comma operator is unused and has no side effects.
2+
3+
4+
==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithStringType.ts (1 errors) ====
5+
// ! operator on string type
6+
var STRING: string;
7+
var STRING1: string[] = ["", "abc"];
8+
9+
function foo(): string { return "abc"; }
10+
11+
class A {
12+
public a: string;
13+
static foo() { return ""; }
14+
}
15+
module M {
16+
export var n: string;
17+
}
18+
19+
var objA = new A();
20+
21+
// string type var
22+
var ResultIsBoolean1 = !STRING;
23+
var ResultIsBoolean2 = !STRING1;
24+
25+
// string type literal
26+
var ResultIsBoolean3 = !"";
27+
var ResultIsBoolean4 = !{ x: "", y: "" };
28+
var ResultIsBoolean5 = !{ x: "", y: (s: string) => { return s; } };
29+
30+
// string type expressions
31+
var ResultIsBoolean6 = !objA.a;
32+
var ResultIsBoolean7 = !M.n;
33+
var ResultIsBoolean8 = !STRING1[0];
34+
var ResultIsBoolean9 = !foo();
35+
var ResultIsBoolean10 = !A.foo();
36+
var ResultIsBoolean11 = !(STRING + STRING);
37+
var ResultIsBoolean12 = !STRING.charAt(0);
38+
39+
// multiple ! operator
40+
var ResultIsBoolean13 = !!STRING;
41+
var ResultIsBoolean14 = !!!(STRING + STRING);
42+
43+
// miss assignment operators
44+
!"";
45+
!STRING;
46+
!STRING1;
47+
!foo();
48+
!objA.a,M.n;
49+
~~~~~~~
50+
!!! error TS2693: Left side of comma operator is unused and has no side effects.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts(51,1): error TS2693: Left side of comma operator is unused and has no side effects.
2+
3+
4+
==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts (1 errors) ====
5+
// - operator on any type
6+
7+
var ANY: any;
8+
var ANY1;
9+
var ANY2: any[] = ["", ""];
10+
var obj: () => {}
11+
var obj1 = { x: "", y: () => { }};
12+
13+
function foo(): any {
14+
var a;
15+
return a;
16+
}
17+
class A {
18+
public a: any;
19+
static foo() {
20+
var a;
21+
return a;
22+
}
23+
}
24+
module M {
25+
export var n: any;
26+
}
27+
var objA = new A();
28+
29+
// any type var
30+
var ResultIsNumber1 = -ANY1;
31+
var ResultIsNumber2 = -ANY2;
32+
var ResultIsNumber3 = -A;
33+
var ResultIsNumber4 = -M;
34+
var ResultIsNumber5 = -obj;
35+
var ResultIsNumber6 = -obj1;
36+
37+
// any type literal
38+
var ResultIsNumber7 = -undefined;
39+
var ResultIsNumber = -null;
40+
41+
// any type expressions
42+
var ResultIsNumber8 = -ANY2[0];
43+
var ResultIsNumber9 = -obj1.x;
44+
var ResultIsNumber10 = -obj1.y;
45+
var ResultIsNumber11 = -objA.a;
46+
var ResultIsNumber12 = -M.n;
47+
var ResultIsNumber13 = -foo();
48+
var ResultIsNumber14 = -A.foo();
49+
var ResultIsNumber15 = -(ANY - ANY1);
50+
51+
// miss assignment operators
52+
-ANY;
53+
-ANY1;
54+
-ANY2[0];
55+
-ANY, ANY1;
56+
~~~~
57+
!!! error TS2693: Left side of comma operator is unused and has no side effects.
58+
-objA.a;
59+
-M.n;
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithBooleanType.ts(33,1): error TS2693: Left side of comma operator is unused and has no side effects.
2+
3+
4+
==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithBooleanType.ts (1 errors) ====
5+
// - operator on boolean type
6+
var BOOLEAN: boolean;
7+
8+
function foo(): boolean { return true; }
9+
10+
class A {
11+
public a: boolean;
12+
static foo() { return false; }
13+
}
14+
module M {
15+
export var n: boolean;
16+
}
17+
18+
var objA = new A();
19+
20+
// boolean type var
21+
var ResultIsNumber1 = -BOOLEAN;
22+
23+
// boolean type literal
24+
var ResultIsNumber2 = -true;
25+
var ResultIsNumber3 = -{ x: true, y: false };
26+
27+
// boolean type expressions
28+
var ResultIsNumber4 = -objA.a;
29+
var ResultIsNumber5 = -M.n;
30+
var ResultIsNumber6 = -foo();
31+
var ResultIsNumber7 = -A.foo();
32+
33+
// miss assignment operators
34+
-true;
35+
-BOOLEAN;
36+
-foo();
37+
-true, false;
38+
~~~~~
39+
!!! error TS2693: Left side of comma operator is unused and has no side effects.
40+
-objA.a;
41+
-M.n;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithEnumType.ts(17,1): error TS2693: Left side of comma operator is unused and has no side effects.
2+
3+
4+
==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithEnumType.ts (1 errors) ====
5+
// - operator on enum type
6+
7+
enum ENUM { };
8+
enum ENUM1 { A, B, "" };
9+
10+
// enum type var
11+
var ResultIsNumber1 = -ENUM;
12+
13+
// expressions
14+
var ResultIsNumber2 = -ENUM1["B"];
15+
var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]);
16+
17+
// miss assignment operators
18+
-ENUM;
19+
-ENUM1;
20+
-ENUM1["B"];
21+
-ENUM, ENUM1;
22+
~~~~~
23+
!!! error TS2693: Left side of comma operator is unused and has no side effects.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithNumberType.ts(41,1): error TS2693: Left side of comma operator is unused and has no side effects.
2+
3+
4+
==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithNumberType.ts (1 errors) ====
5+
// - operator on number type
6+
var NUMBER: number;
7+
var NUMBER1: number[] = [1, 2];
8+
9+
function foo(): number { return 1; }
10+
11+
class A {
12+
public a: number;
13+
static foo() { return 1; }
14+
}
15+
module M {
16+
export var n: number;
17+
}
18+
19+
var objA = new A();
20+
21+
// number type var
22+
var ResultIsNumber1 = -NUMBER;
23+
var ResultIsNumber2 = -NUMBER1;
24+
25+
// number type literal
26+
var ResultIsNumber3 = -1;
27+
var ResultIsNumber4 = -{ x: 1, y: 2};
28+
var ResultIsNumber5 = -{ x: 1, y: (n: number) => { return n; } };
29+
30+
// number type expressions
31+
var ResultIsNumber6 = -objA.a;
32+
var ResultIsNumber7 = -M.n;
33+
var ResultIsNumber8 = -NUMBER1[0];
34+
var ResultIsNumber9 = -foo();
35+
var ResultIsNumber10 = -A.foo();
36+
var ResultIsNumber11 = -(NUMBER - NUMBER);
37+
38+
// miss assignment operators
39+
-1;
40+
-NUMBER;
41+
-NUMBER1;
42+
-foo();
43+
-objA.a;
44+
-M.n;
45+
-objA.a, M.n;
46+
~~~~~~~
47+
!!! error TS2693: Left side of comma operator is unused and has no side effects.

0 commit comments

Comments
 (0)