From 509de27908b6da490b66446ea334c50bae6385e8 Mon Sep 17 00:00:00 2001 From: Ryan Cavanaugh Date: Tue, 13 Sep 2016 11:51:03 -0700 Subject: [PATCH] Baseline update --- ...icalNotOperatorWithAnyOtherType.errors.txt | 5 +- ...gicalNotOperatorWithBooleanType.errors.txt | 44 +++++++++++++ .../logicalNotOperatorWithEnumType.errors.txt | 27 ++++++++ ...ogicalNotOperatorWithNumberType.errors.txt | 51 +++++++++++++++ ...ogicalNotOperatorWithStringType.errors.txt | 50 +++++++++++++++ .../negateOperatorWithAnyOtherType.errors.txt | 59 +++++++++++++++++ .../negateOperatorWithBooleanType.errors.txt | 41 ++++++++++++ .../negateOperatorWithEnumType.errors.txt | 23 +++++++ .../negateOperatorWithNumberType.errors.txt | 47 ++++++++++++++ .../negateOperatorWithStringType.errors.txt | 46 ++++++++++++++ .../newOperatorErrorCases.errors.txt | 5 +- .../parenthesizedContexualTyping1.errors.txt | 44 +++++++++++++ .../parenthesizedContexualTyping2.errors.txt | 51 +++++++++++++++ .../reference/parser512325.errors.txt | 8 ++- .../parserArrowFunctionExpression4.errors.txt | 5 +- .../parserCastVersusArrowFunction1.errors.txt | 5 +- .../parserComputedPropertyName35.errors.txt | 5 +- ...RecoveryArrayLiteralExpression3.errors.txt | 8 ++- ...parserTernaryAndCommaOperators1.errors.txt | 5 +- .../plusOperatorWithAnyOtherType.errors.txt | 5 +- .../plusOperatorWithBooleanType.errors.txt | 41 ++++++++++++ .../plusOperatorWithEnumType.errors.txt | 24 +++++++ .../plusOperatorWithNumberType.errors.txt | 47 ++++++++++++++ .../plusOperatorWithStringType.errors.txt | 46 ++++++++++++++ .../sourceMapValidationFor.errors.txt | 5 +- ...gLiteralsWithSwitchStatements03.errors.txt | 8 ++- ...gLiteralsWithSwitchStatements04.errors.txt | 14 ++++- .../reference/systemModule16.errors.txt | 14 ++++- tests/baselines/reference/tsxEmit3.errors.txt | 56 +++++++++++++++++ .../typecheckCommaExpression.errors.txt | 5 +- .../typeofOperatorWithAnyOtherType.errors.txt | 5 +- .../typeofOperatorWithBooleanType.errors.txt | 57 +++++++++++++++++ .../typeofOperatorWithEnumType.errors.txt | 34 ++++++++++ .../typeofOperatorWithNumberType.errors.txt | 63 +++++++++++++++++++ .../typeofOperatorWithStringType.errors.txt | 5 +- .../reference/widenedTypes.errors.txt | 5 +- tests/baselines/reference/witness.errors.txt | 20 +++++- 37 files changed, 965 insertions(+), 18 deletions(-) create mode 100644 tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt create mode 100644 tests/baselines/reference/logicalNotOperatorWithEnumType.errors.txt create mode 100644 tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt create mode 100644 tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt create mode 100644 tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt create mode 100644 tests/baselines/reference/negateOperatorWithBooleanType.errors.txt create mode 100644 tests/baselines/reference/negateOperatorWithEnumType.errors.txt create mode 100644 tests/baselines/reference/negateOperatorWithNumberType.errors.txt create mode 100644 tests/baselines/reference/negateOperatorWithStringType.errors.txt create mode 100644 tests/baselines/reference/parenthesizedContexualTyping1.errors.txt create mode 100644 tests/baselines/reference/parenthesizedContexualTyping2.errors.txt create mode 100644 tests/baselines/reference/plusOperatorWithBooleanType.errors.txt create mode 100644 tests/baselines/reference/plusOperatorWithEnumType.errors.txt create mode 100644 tests/baselines/reference/plusOperatorWithNumberType.errors.txt create mode 100644 tests/baselines/reference/plusOperatorWithStringType.errors.txt create mode 100644 tests/baselines/reference/tsxEmit3.errors.txt create mode 100644 tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt create mode 100644 tests/baselines/reference/typeofOperatorWithEnumType.errors.txt create mode 100644 tests/baselines/reference/typeofOperatorWithNumberType.errors.txt diff --git a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt index 883f2ee5861..e8a9b49f444 100644 --- a/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/logicalNotOperatorWithAnyOtherType.errors.txt @@ -1,9 +1,10 @@ tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(45,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(46,27): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(47,27): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts(57,1): error TS2693: Left side of comma operator is unused and has no side effects. -==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts (3 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithAnyOtherType.ts (4 errors) ==== // ! operator on any type var ANY: any; @@ -67,5 +68,7 @@ tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNot !ANY1; !ANY2[0]; !ANY, ANY1; + ~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. !objA.a; !M.n; \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt new file mode 100644 index 00000000000..fbd7aa599b8 --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithBooleanType.errors.txt @@ -0,0 +1,44 @@ +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithBooleanType.ts(36,1): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithBooleanType.ts (1 errors) ==== + // ! operator on boolean type + var BOOLEAN: boolean; + + function foo(): boolean { return true; } + + class A { + public a: boolean; + static foo() { return false; } + } + module M { + export var n: boolean; + } + + var objA = new A(); + + // boolean type var + var ResultIsBoolean1 = !BOOLEAN; + + // boolean type literal + var ResultIsBoolean2 = !true; + var ResultIsBoolean3 = !{ x: true, y: false }; + + // boolean type expressions + var ResultIsBoolean4 = !objA.a; + var ResultIsBoolean5 = !M.n; + var ResultIsBoolean6 = !foo(); + var ResultIsBoolean7 = !A.foo(); + + // multiple ! operators + var ResultIsBoolean = !!BOOLEAN; + + // miss assignment operators + !true; + !BOOLEAN; + !foo(); + !true, false; + ~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + !objA.a; + !M.n; \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithEnumType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithEnumType.errors.txt new file mode 100644 index 00000000000..eeb7b30e71c --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithEnumType.errors.txt @@ -0,0 +1,27 @@ +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithEnumType.ts(21,1): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithEnumType.ts (1 errors) ==== + // ! operator on enum type + + enum ENUM { A, B, C }; + enum ENUM1 { }; + + // enum type var + var ResultIsBoolean1 = !ENUM; + + // enum type expressions + var ResultIsBoolean2 = !ENUM["B"]; + var ResultIsBoolean3 = !(ENUM.B + ENUM["C"]); + + // multiple ! operators + var ResultIsBoolean4 = !!ENUM; + var ResultIsBoolean5 = !!!(ENUM["B"] + ENUM.C); + + // miss assignment operators + !ENUM; + !ENUM1; + !ENUM.B; + !ENUM, ENUM1; + ~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt new file mode 100644 index 00000000000..54aac1cb05f --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithNumberType.errors.txt @@ -0,0 +1,51 @@ +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithNumberType.ts(45,1): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithNumberType.ts (1 errors) ==== + // ! operator on number type + var NUMBER: number; + var NUMBER1: number[] = [1, 2]; + + function foo(): number { return 1; } + + class A { + public a: number; + static foo() { return 1; } + } + module M { + export var n: number; + } + + var objA = new A(); + + // number type var + var ResultIsBoolean1 = !NUMBER; + var ResultIsBoolean2 = !NUMBER1; + + // number type literal + var ResultIsBoolean3 = !1; + var ResultIsBoolean4 = !{ x: 1, y: 2}; + var ResultIsBoolean5 = !{ x: 1, y: (n: number) => { return n; } }; + + // number type expressions + var ResultIsBoolean6 = !objA.a; + var ResultIsBoolean7 = !M.n; + var ResultIsBoolean8 = !NUMBER1[0]; + var ResultIsBoolean9 = !foo(); + var ResultIsBoolean10 = !A.foo(); + var ResultIsBoolean11 = !(NUMBER + NUMBER); + + // multiple ! operator + var ResultIsBoolean12 = !!NUMBER; + var ResultIsBoolean13 = !!!(NUMBER + NUMBER); + + // miss assignment operators + !1; + !NUMBER; + !NUMBER1; + !foo(); + !objA.a; + !M.n; + !objA.a, M.n; + ~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt b/tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt new file mode 100644 index 00000000000..1d84af9ec61 --- /dev/null +++ b/tests/baselines/reference/logicalNotOperatorWithStringType.errors.txt @@ -0,0 +1,50 @@ +tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithStringType.ts(44,1): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/logicalNotOperator/logicalNotOperatorWithStringType.ts (1 errors) ==== + // ! operator on string type + var STRING: string; + var STRING1: string[] = ["", "abc"]; + + function foo(): string { return "abc"; } + + class A { + public a: string; + static foo() { return ""; } + } + module M { + export var n: string; + } + + var objA = new A(); + + // string type var + var ResultIsBoolean1 = !STRING; + var ResultIsBoolean2 = !STRING1; + + // string type literal + var ResultIsBoolean3 = !""; + var ResultIsBoolean4 = !{ x: "", y: "" }; + var ResultIsBoolean5 = !{ x: "", y: (s: string) => { return s; } }; + + // string type expressions + var ResultIsBoolean6 = !objA.a; + var ResultIsBoolean7 = !M.n; + var ResultIsBoolean8 = !STRING1[0]; + var ResultIsBoolean9 = !foo(); + var ResultIsBoolean10 = !A.foo(); + var ResultIsBoolean11 = !(STRING + STRING); + var ResultIsBoolean12 = !STRING.charAt(0); + + // multiple ! operator + var ResultIsBoolean13 = !!STRING; + var ResultIsBoolean14 = !!!(STRING + STRING); + + // miss assignment operators + !""; + !STRING; + !STRING1; + !foo(); + !objA.a,M.n; + ~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt new file mode 100644 index 00000000000..e3ed170cd98 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithAnyOtherType.errors.txt @@ -0,0 +1,59 @@ +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts(51,1): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithAnyOtherType.ts (1 errors) ==== + // - operator on any type + + var ANY: any; + var ANY1; + var ANY2: any[] = ["", ""]; + var obj: () => {} + var obj1 = { x: "", y: () => { }}; + + function foo(): any { + var a; + return a; + } + class A { + public a: any; + static foo() { + var a; + return a; + } + } + module M { + export var n: any; + } + var objA = new A(); + + // any type var + var ResultIsNumber1 = -ANY1; + var ResultIsNumber2 = -ANY2; + var ResultIsNumber3 = -A; + var ResultIsNumber4 = -M; + var ResultIsNumber5 = -obj; + var ResultIsNumber6 = -obj1; + + // any type literal + var ResultIsNumber7 = -undefined; + var ResultIsNumber = -null; + + // any type expressions + var ResultIsNumber8 = -ANY2[0]; + var ResultIsNumber9 = -obj1.x; + var ResultIsNumber10 = -obj1.y; + var ResultIsNumber11 = -objA.a; + var ResultIsNumber12 = -M.n; + var ResultIsNumber13 = -foo(); + var ResultIsNumber14 = -A.foo(); + var ResultIsNumber15 = -(ANY - ANY1); + + // miss assignment operators + -ANY; + -ANY1; + -ANY2[0]; + -ANY, ANY1; + ~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + -objA.a; + -M.n; \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithBooleanType.errors.txt b/tests/baselines/reference/negateOperatorWithBooleanType.errors.txt new file mode 100644 index 00000000000..69f382f3c60 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithBooleanType.errors.txt @@ -0,0 +1,41 @@ +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithBooleanType.ts(33,1): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithBooleanType.ts (1 errors) ==== + // - operator on boolean type + var BOOLEAN: boolean; + + function foo(): boolean { return true; } + + class A { + public a: boolean; + static foo() { return false; } + } + module M { + export var n: boolean; + } + + var objA = new A(); + + // boolean type var + var ResultIsNumber1 = -BOOLEAN; + + // boolean type literal + var ResultIsNumber2 = -true; + var ResultIsNumber3 = -{ x: true, y: false }; + + // boolean type expressions + var ResultIsNumber4 = -objA.a; + var ResultIsNumber5 = -M.n; + var ResultIsNumber6 = -foo(); + var ResultIsNumber7 = -A.foo(); + + // miss assignment operators + -true; + -BOOLEAN; + -foo(); + -true, false; + ~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + -objA.a; + -M.n; \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithEnumType.errors.txt b/tests/baselines/reference/negateOperatorWithEnumType.errors.txt new file mode 100644 index 00000000000..9666a49e104 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithEnumType.errors.txt @@ -0,0 +1,23 @@ +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithEnumType.ts(17,1): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithEnumType.ts (1 errors) ==== + // - operator on enum type + + enum ENUM { }; + enum ENUM1 { A, B, "" }; + + // enum type var + var ResultIsNumber1 = -ENUM; + + // expressions + var ResultIsNumber2 = -ENUM1["B"]; + var ResultIsNumber3 = -(ENUM1.B + ENUM1[""]); + + // miss assignment operators + -ENUM; + -ENUM1; + -ENUM1["B"]; + -ENUM, ENUM1; + ~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithNumberType.errors.txt b/tests/baselines/reference/negateOperatorWithNumberType.errors.txt new file mode 100644 index 00000000000..b6ea6c0f288 --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithNumberType.errors.txt @@ -0,0 +1,47 @@ +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithNumberType.ts(41,1): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithNumberType.ts (1 errors) ==== + // - operator on number type + var NUMBER: number; + var NUMBER1: number[] = [1, 2]; + + function foo(): number { return 1; } + + class A { + public a: number; + static foo() { return 1; } + } + module M { + export var n: number; + } + + var objA = new A(); + + // number type var + var ResultIsNumber1 = -NUMBER; + var ResultIsNumber2 = -NUMBER1; + + // number type literal + var ResultIsNumber3 = -1; + var ResultIsNumber4 = -{ x: 1, y: 2}; + var ResultIsNumber5 = -{ x: 1, y: (n: number) => { return n; } }; + + // number type expressions + var ResultIsNumber6 = -objA.a; + var ResultIsNumber7 = -M.n; + var ResultIsNumber8 = -NUMBER1[0]; + var ResultIsNumber9 = -foo(); + var ResultIsNumber10 = -A.foo(); + var ResultIsNumber11 = -(NUMBER - NUMBER); + + // miss assignment operators + -1; + -NUMBER; + -NUMBER1; + -foo(); + -objA.a; + -M.n; + -objA.a, M.n; + ~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/negateOperatorWithStringType.errors.txt b/tests/baselines/reference/negateOperatorWithStringType.errors.txt new file mode 100644 index 00000000000..7eb59e5b2ca --- /dev/null +++ b/tests/baselines/reference/negateOperatorWithStringType.errors.txt @@ -0,0 +1,46 @@ +tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithStringType.ts(40,1): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/negateOperator/negateOperatorWithStringType.ts (1 errors) ==== + // - operator on string type + var STRING: string; + var STRING1: string[] = ["", "abc"]; + + function foo(): string { return "abc"; } + + class A { + public a: string; + static foo() { return ""; } + } + module M { + export var n: string; + } + + var objA = new A(); + + // string type var + var ResultIsNumber1 = -STRING; + var ResultIsNumber2 = -STRING1; + + // string type literal + var ResultIsNumber3 = -""; + var ResultIsNumber4 = -{ x: "", y: "" }; + var ResultIsNumber5 = -{ x: "", y: (s: string) => { return s; } }; + + // string type expressions + var ResultIsNumber6 = -objA.a; + var ResultIsNumber7 = -M.n; + var ResultIsNumber8 = -STRING1[0]; + var ResultIsNumber9 = -foo(); + var ResultIsNumber10 = -A.foo(); + var ResultIsNumber11 = -(STRING + STRING); + var ResultIsNumber12 = -STRING.charAt(0); + + // miss assignment operators + -""; + -STRING; + -STRING1; + -foo(); + -objA.a,M.n; + ~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/newOperatorErrorCases.errors.txt b/tests/baselines/reference/newOperatorErrorCases.errors.txt index 11a6beb1d39..364caa5f48d 100644 --- a/tests/baselines/reference/newOperatorErrorCases.errors.txt +++ b/tests/baselines/reference/newOperatorErrorCases.errors.txt @@ -1,9 +1,10 @@ tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(27,16): error TS1005: ',' expected. +tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(27,16): error TS2693: Left side of comma operator is unused and has no side effects. tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(32,23): error TS1005: '(' expected. tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(37,9): error TS2350: Only a void function can be called with the 'new' keyword. -==== tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts (3 errors) ==== +==== tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts (4 errors) ==== class C0 { @@ -33,6 +34,8 @@ tests/cases/conformance/expressions/newOperator/newOperatorErrorCases.ts(37,9): var b = new C0 32, ''; // Parse error ~~ !!! error TS1005: ',' expected. + ~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. // Generic construct expression with no parentheses var c1 = new T; diff --git a/tests/baselines/reference/parenthesizedContexualTyping1.errors.txt b/tests/baselines/reference/parenthesizedContexualTyping1.errors.txt new file mode 100644 index 00000000000..01b3fe8dadd --- /dev/null +++ b/tests/baselines/reference/parenthesizedContexualTyping1.errors.txt @@ -0,0 +1,44 @@ +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(28,32): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(28,56): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(29,33): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts(29,57): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping1.ts (4 errors) ==== + + function fun(g: (x: T) => T, x: T): T; + function fun(g: (x: T) => T, h: (y: T) => T, x: T): T; + function fun(g: (x: T) => T, x: T): T { + return g(x); + } + + var a = fun(x => x, 10); + var b = fun((x => x), 10); + var c = fun(((x => x)), 10); + var d = fun((((x => x))), 10); + + var e = fun(x => x, x => x, 10); + var f = fun((x => x), (x => x), 10); + var g = fun(((x => x)), ((x => x)), 10); + var h = fun((((x => x))), ((x => x)), 10); + + // Ternaries in parens + var i = fun((Math.random() < 0.5 ? x => x : x => undefined), 10); + var j = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), 10); + var k = fun((Math.random() < 0.5 ? (x => x) : (x => undefined)), x => x, 10); + var l = fun(((Math.random() < 0.5 ? ((x => x)) : ((x => undefined)))), ((x => x)), 10); + + var lambda1: (x: number) => number = x => x; + var lambda2: (x: number) => number = (x => x); + + type ObjType = { x: (p: number) => string; y: (p: string) => number }; + var obj1: ObjType = { x: x => (x, undefined), y: y => (y, undefined) }; + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + var obj2: ObjType = ({ x: x => (x, undefined), y: y => (y, undefined) }); + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/parenthesizedContexualTyping2.errors.txt b/tests/baselines/reference/parenthesizedContexualTyping2.errors.txt new file mode 100644 index 00000000000..0aaa0ebead7 --- /dev/null +++ b/tests/baselines/reference/parenthesizedContexualTyping2.errors.txt @@ -0,0 +1,51 @@ +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(35,32): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(35,56): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(36,33): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts(36,57): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/contextualTyping/parenthesizedContexualTyping2.ts (4 errors) ==== + // These tests ensure that in cases where it may *appear* that a value has a type, + // they actually are properly being contextually typed. The way we test this is + // that we invoke contextually typed arguments with type arguments. + // Since 'any' cannot be invoked with type arguments, we should get errors + // back if contextual typing is not taking effect. + + type FuncType = (x: (p: T) => T) => typeof x; + + function fun(f: FuncType, x: T): T; + function fun(f: FuncType, g: FuncType, x: T): T; + function fun(...rest: any[]): T { + return undefined; + } + + var a = fun(x => { x(undefined); return x; }, 10); + var b = fun((x => { x(undefined); return x; }), 10); + var c = fun(((x => { x(undefined); return x; })), 10); + var d = fun((((x => { x(undefined); return x; }))), 10); + + var e = fun(x => { x(undefined); return x; }, x => { x(undefined); return x; }, 10); + var f = fun((x => { x(undefined); return x; }),(x => { x(undefined); return x; }), 10); + var g = fun(((x => { x(undefined); return x; })),((x => { x(undefined); return x; })), 10); + var h = fun((((x => { x(undefined); return x; }))),((x => { x(undefined); return x; })), 10); + + // Ternaries in parens + var i = fun((Math.random() < 0.5 ? x => { x(undefined); return x; } : x => undefined), 10); + var j = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), 10); + var k = fun((Math.random() < 0.5 ? (x => { x(undefined); return x; }) : (x => undefined)), x => { x(undefined); return x; }, 10); + var l = fun(((Math.random() < 0.5 ? ((x => { x(undefined); return x; })) : ((x => undefined)))),((x => { x(undefined); return x; })), 10); + + var lambda1: FuncType = x => { x(undefined); return x; }; + var lambda2: FuncType = (x => { x(undefined); return x; }); + + type ObjType = { x: (p: number) => string; y: (p: string) => number }; + var obj1: ObjType = { x: x => (x, undefined), y: y => (y, undefined) }; + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + var obj2: ObjType = ({ x: x => (x, undefined), y: y => (y, undefined) }); + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/parser512325.errors.txt b/tests/baselines/reference/parser512325.errors.txt index 57e75d2beff..c6bdd812d08 100644 --- a/tests/baselines/reference/parser512325.errors.txt +++ b/tests/baselines/reference/parser512325.errors.txt @@ -1,5 +1,7 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,11): error TS2304: Cannot find name 'a'. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,11): error TS2693: Left side of comma operator is unused and has no side effects. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,15): error TS2304: Cannot find name 'b'. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,15): error TS2693: Left side of comma operator is unused and has no side effects. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,18): error TS2304: Cannot find name 'c'. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,22): error TS1005: ';' expected. tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,25): error TS2304: Cannot find name 'a'. @@ -7,12 +9,16 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,27) tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts(1,29): error TS2304: Cannot find name 'c'. -==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts (7 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser512325.ts (9 errors) ==== var tt = (a, (b, c)) => a+b+c; ~ !!! error TS2304: Cannot find name 'a'. + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'b'. + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'c'. ~~ diff --git a/tests/baselines/reference/parserArrowFunctionExpression4.errors.txt b/tests/baselines/reference/parserArrowFunctionExpression4.errors.txt index 9e04f60139d..3a32940d4fa 100644 --- a/tests/baselines/reference/parserArrowFunctionExpression4.errors.txt +++ b/tests/baselines/reference/parserArrowFunctionExpression4.errors.txt @@ -1,10 +1,13 @@ tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts(1,1): error TS2304: Cannot find name 'a'. +tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts(1,6): error TS2693: Left side of comma operator is unused and has no side effects. tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts(1,17): error TS2304: Cannot find name 'a'. -==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ArrowFunctionExpressions/parserArrowFunctionExpression4.ts (3 errors) ==== a = (() => { }, a) ~ !!! error TS2304: Cannot find name 'a'. + ~~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'a'. \ No newline at end of file diff --git a/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt b/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt index 6faa7934898..10d199c1569 100644 --- a/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt +++ b/tests/baselines/reference/parserCastVersusArrowFunction1.errors.txt @@ -7,13 +7,14 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunctio tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(8,13): error TS2304: Cannot find name 'a'. tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(9,10): error TS2304: Cannot find name 'T'. tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(9,13): error TS2304: Cannot find name 'a'. +tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(9,13): error TS2693: Left side of comma operator is unused and has no side effects. tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(9,16): error TS2304: Cannot find name 'b'. tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(10,10): error TS2304: Cannot find name 'T'. tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(10,13): error TS2304: Cannot find name 'a'. tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts(10,20): error TS2304: Cannot find name 'b'. -==== tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts (13 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunction1.ts (14 errors) ==== var v = () => 1; var v = a; ~ @@ -41,6 +42,8 @@ tests/cases/conformance/parser/ecmascript5/Generics/parserCastVersusArrowFunctio !!! error TS2304: Cannot find name 'T'. ~ !!! error TS2304: Cannot find name 'a'. + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'b'. var v = (a = 1, b = 2); diff --git a/tests/baselines/reference/parserComputedPropertyName35.errors.txt b/tests/baselines/reference/parserComputedPropertyName35.errors.txt index e603d1c73fd..48831c7bb3d 100644 --- a/tests/baselines/reference/parserComputedPropertyName35.errors.txt +++ b/tests/baselines/reference/parserComputedPropertyName35.errors.txt @@ -1,9 +1,12 @@ +tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts(2,6): error TS2693: Left side of comma operator is unused and has no side effects. tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts(2,6): error TS1171: A comma expression is not allowed in a computed property name. -==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts (1 errors) ==== +==== tests/cases/conformance/parser/ecmascript6/ComputedPropertyNames/parserComputedPropertyName35.ts (2 errors) ==== var x = { [0, 1]: { } + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~~~~ !!! error TS1171: A comma expression is not allowed in a computed property name. } \ No newline at end of file diff --git a/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt b/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt index 69997baef28..66d175c7d4a 100644 --- a/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt +++ b/tests/baselines/reference/parserErrorRecoveryArrayLiteralExpression3.errors.txt @@ -1,12 +1,18 @@ tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts(2,54): error TS1005: ',' expected. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts(2,56): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts(2,56): error TS2693: Left side of comma operator is unused and has no side effects. tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts(2,105): error TS1005: ';' expected. -==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ArrayLiteralExpressions/parserErrorRecoveryArrayLiteralExpression3.ts (4 errors) ==== var texCoords = [2, 2, 0.5000001192092895, 0.8749999 ; 403953552, 0.5000001192092895, 0.8749999403953552]; ~ !!! error TS1005: ',' expected. + ~~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/parserTernaryAndCommaOperators1.errors.txt b/tests/baselines/reference/parserTernaryAndCommaOperators1.errors.txt index 3efccba3359..0b7942830f4 100644 --- a/tests/baselines/reference/parserTernaryAndCommaOperators1.errors.txt +++ b/tests/baselines/reference/parserTernaryAndCommaOperators1.errors.txt @@ -1,12 +1,15 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts(1,1): error TS2304: Cannot find name 'b'. +tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts(1,1): error TS2693: Left side of comma operator is unused and has no side effects. tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts(1,16): error TS2304: Cannot find name 'c'. tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts(1,21): error TS2304: Cannot find name 'd'. -==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts (3 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parserTernaryAndCommaOperators1.ts (4 errors) ==== b.src ? 1 : 2, c && d; ~ !!! error TS2304: Cannot find name 'b'. + ~~~~~~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'c'. ~ diff --git a/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt index bc76e073234..d26c3b1df8e 100644 --- a/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/plusOperatorWithAnyOtherType.errors.txt @@ -1,9 +1,10 @@ tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(46,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(47,26): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(48,26): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts(54,1): error TS2693: Left side of comma operator is unused and has no side effects. -==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts (3 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithAnyOtherType.ts (4 errors) ==== // + operator on any type var ANY: any; @@ -64,5 +65,7 @@ tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWith +ANY1; +ANY2[0]; +ANY, ANY1; + ~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. +objA.a; +M.n; \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithBooleanType.errors.txt b/tests/baselines/reference/plusOperatorWithBooleanType.errors.txt new file mode 100644 index 00000000000..9390c92ce38 --- /dev/null +++ b/tests/baselines/reference/plusOperatorWithBooleanType.errors.txt @@ -0,0 +1,41 @@ +tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithBooleanType.ts(33,1): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithBooleanType.ts (1 errors) ==== + // + operator on boolean type + var BOOLEAN: boolean; + + function foo(): boolean { return true; } + + class A { + public a: boolean; + static foo() { return false; } + } + module M { + export var n: boolean; + } + + var objA = new A(); + + // boolean type var + var ResultIsNumber1 = +BOOLEAN; + + // boolean type literal + var ResultIsNumber2 = +true; + var ResultIsNumber3 = +{ x: true, y: false }; + + // boolean type expressions + var ResultIsNumber4 = +objA.a; + var ResultIsNumber5 = +M.n; + var ResultIsNumber6 = +foo(); + var ResultIsNumber7 = +A.foo(); + + // miss assignment operators + +true; + +BOOLEAN; + +foo(); + +true, false; + ~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + +objA.a; + +M.n; \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithEnumType.errors.txt b/tests/baselines/reference/plusOperatorWithEnumType.errors.txt new file mode 100644 index 00000000000..d1277867ca9 --- /dev/null +++ b/tests/baselines/reference/plusOperatorWithEnumType.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithEnumType.ts(18,1): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithEnumType.ts (1 errors) ==== + // + operator on enum type + + enum ENUM { }; + enum ENUM1 { A, B, "" }; + + // enum type var + var ResultIsNumber1 = +ENUM; + var ResultIsNumber2 = +ENUM1; + + // enum type expressions + var ResultIsNumber3 = +ENUM1["A"]; + var ResultIsNumber4 = +(ENUM[0] + ENUM1["B"]); + + // miss assignment operators + +ENUM; + +ENUM1; + +ENUM1.B; + +ENUM, ENUM1; + ~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithNumberType.errors.txt b/tests/baselines/reference/plusOperatorWithNumberType.errors.txt new file mode 100644 index 00000000000..c245a04eb69 --- /dev/null +++ b/tests/baselines/reference/plusOperatorWithNumberType.errors.txt @@ -0,0 +1,47 @@ +tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithNumberType.ts(41,1): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithNumberType.ts (1 errors) ==== + // + operator on number type + var NUMBER: number; + var NUMBER1: number[] = [1, 2]; + + function foo(): number { return 1; } + + class A { + public a: number; + static foo() { return 1; } + } + module M { + export var n: number; + } + + var objA = new A(); + + // number type var + var ResultIsNumber1 = +NUMBER; + var ResultIsNumber2 = +NUMBER1; + + // number type literal + var ResultIsNumber3 = +1; + var ResultIsNumber4 = +{ x: 1, y: 2}; + var ResultIsNumber5 = +{ x: 1, y: (n: number) => { return n; } }; + + // number type expressions + var ResultIsNumber6 = +objA.a; + var ResultIsNumber7 = +M.n; + var ResultIsNumber8 = +NUMBER1[0]; + var ResultIsNumber9 = +foo(); + var ResultIsNumber10 = +A.foo(); + var ResultIsNumber11 = +(NUMBER + NUMBER); + + // miss assignment operators + +1; + +NUMBER; + +NUMBER1; + +foo(); + +objA.a; + +M.n; + +objA.a, M.n; + ~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/plusOperatorWithStringType.errors.txt b/tests/baselines/reference/plusOperatorWithStringType.errors.txt new file mode 100644 index 00000000000..979da03c1bd --- /dev/null +++ b/tests/baselines/reference/plusOperatorWithStringType.errors.txt @@ -0,0 +1,46 @@ +tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithStringType.ts(40,1): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/plusOperator/plusOperatorWithStringType.ts (1 errors) ==== + // + operator on string type + var STRING: string; + var STRING1: string[] = ["", "abc"]; + + function foo(): string { return "abc"; } + + class A { + public a: string; + static foo() { return ""; } + } + module M { + export var n: string; + } + + var objA = new A(); + + // string type var + var ResultIsNumber1 = +STRING; + var ResultIsNumber2 = +STRING1; + + // string type literal + var ResultIsNumber3 = +""; + var ResultIsNumber4 = +{ x: "", y: "" }; + var ResultIsNumber5 = +{ x: "", y: (s: string) => { return s; } }; + + // string type expressions + var ResultIsNumber6 = +objA.a; + var ResultIsNumber7 = +M.n; + var ResultIsNumber8 = +STRING1[0]; + var ResultIsNumber9 = +foo(); + var ResultIsNumber10 = +A.foo(); + var ResultIsNumber11 = +(STRING + STRING); + var ResultIsNumber12 = +STRING.charAt(0); + + // miss assignment operators + +""; + +STRING; + +STRING1; + +foo(); + +objA.a,M.n; + ~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/sourceMapValidationFor.errors.txt b/tests/baselines/reference/sourceMapValidationFor.errors.txt index 6949d7545ed..d665ff8ec93 100644 --- a/tests/baselines/reference/sourceMapValidationFor.errors.txt +++ b/tests/baselines/reference/sourceMapValidationFor.errors.txt @@ -1,9 +1,10 @@ tests/cases/compiler/sourceMapValidationFor.ts(2,5): error TS2304: Cannot find name 'WScript'. tests/cases/compiler/sourceMapValidationFor.ts(6,5): error TS2304: Cannot find name 'WScript'. tests/cases/compiler/sourceMapValidationFor.ts(20,1): error TS7027: Unreachable code detected. +tests/cases/compiler/sourceMapValidationFor.ts(32,21): error TS2693: Left side of comma operator is unused and has no side effects. -==== tests/cases/compiler/sourceMapValidationFor.ts (3 errors) ==== +==== tests/cases/compiler/sourceMapValidationFor.ts (4 errors) ==== for (var i = 0; i < 10; i++) { WScript.Echo("i: " + i); ~~~~~~~ @@ -42,4 +43,6 @@ tests/cases/compiler/sourceMapValidationFor.ts(20,1): error TS7027: Unreachable i++; } for (i = 0, j = 20; j < 20, i < 20; j++) { + ~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. } \ No newline at end of file diff --git a/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt b/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt index c5aedb81334..6e06101ec77 100644 --- a/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt +++ b/tests/baselines/reference/stringLiteralsWithSwitchStatements03.errors.txt @@ -2,6 +2,8 @@ tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(10 Type '"baz"' is not comparable to type '"foo"'. tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(12,10): error TS2678: Type '"bar"' is not comparable to type '"foo"'. tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(14,10): error TS2678: Type '"baz"' is not comparable to type '"foo"'. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(14,11): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(14,11): error TS2693: Left side of comma operator is unused and has no side effects. tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(20,10): error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'. Type '"baz"' is not comparable to type '"foo"'. tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(22,10): error TS2678: Type '"bar" | "baz"' is not comparable to type '"foo"'. @@ -10,7 +12,7 @@ tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(23 Type '"baz"' is not comparable to type '"foo"'. -==== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts (6 errors) ==== +==== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts (8 errors) ==== let x: "foo"; let y: "foo" | "bar"; let z: "bar"; @@ -32,6 +34,10 @@ tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements03.ts(23 case (x, y, ("baz")): ~~~~~~~~~~~~~~~ !!! error TS2678: Type '"baz"' is not comparable to type '"foo"'. + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + ~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. x; y; break; diff --git a/tests/baselines/reference/stringLiteralsWithSwitchStatements04.errors.txt b/tests/baselines/reference/stringLiteralsWithSwitchStatements04.errors.txt index 10a461c753a..c8626674f89 100644 --- a/tests/baselines/reference/stringLiteralsWithSwitchStatements04.errors.txt +++ b/tests/baselines/reference/stringLiteralsWithSwitchStatements04.errors.txt @@ -1,7 +1,11 @@ +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(7,10): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(9,10): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(11,10): error TS2693: Left side of comma operator is unused and has no side effects. tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(11,10): error TS2678: Type '"baz"' is not comparable to type '"foo" | "bar"'. +tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(13,10): error TS2693: Left side of comma operator is unused and has no side effects. -==== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts (1 errors) ==== +==== tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts (5 errors) ==== let x: "foo"; let y: "foo" | "bar"; @@ -9,14 +13,22 @@ tests/cases/conformance/types/literal/stringLiteralsWithSwitchStatements04.ts(11 switch (y) { case "foo", x: + ~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. break; case x, "foo": + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. break; case x, "baz": + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~~~~~~~~ !!! error TS2678: Type '"baz"' is not comparable to type '"foo" | "bar"'. break; case "baz", x: + ~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. break; case "baz" && "bar": break; diff --git a/tests/baselines/reference/systemModule16.errors.txt b/tests/baselines/reference/systemModule16.errors.txt index 8c79c9218e4..e9ed4f3ab86 100644 --- a/tests/baselines/reference/systemModule16.errors.txt +++ b/tests/baselines/reference/systemModule16.errors.txt @@ -4,9 +4,13 @@ tests/cases/compiler/systemModule16.ts(4,15): error TS2307: Cannot find module ' tests/cases/compiler/systemModule16.ts(5,15): error TS2307: Cannot find module 'bar'. tests/cases/compiler/systemModule16.ts(8,32): error TS2307: Cannot find module 'foo'. tests/cases/compiler/systemModule16.ts(9,32): error TS2307: Cannot find module 'bar'. +tests/cases/compiler/systemModule16.ts(11,1): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/systemModule16.ts(11,1): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/systemModule16.ts(11,1): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/compiler/systemModule16.ts(11,1): error TS2693: Left side of comma operator is unused and has no side effects. -==== tests/cases/compiler/systemModule16.ts (6 errors) ==== +==== tests/cases/compiler/systemModule16.ts (10 errors) ==== import * as x from "foo"; ~~~~~ @@ -30,4 +34,12 @@ tests/cases/compiler/systemModule16.ts(9,32): error TS2307: Cannot find module ' !!! error TS2307: Cannot find module 'bar'. x,y,a1,b1,d1; + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + ~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + ~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + ~~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. \ No newline at end of file diff --git a/tests/baselines/reference/tsxEmit3.errors.txt b/tests/baselines/reference/tsxEmit3.errors.txt new file mode 100644 index 00000000000..1fe8a566f81 --- /dev/null +++ b/tests/baselines/reference/tsxEmit3.errors.txt @@ -0,0 +1,56 @@ +tests/cases/conformance/jsx/file.tsx(19,2): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/jsx/file.tsx(23,3): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/jsx/file.tsx(26,3): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/jsx/file.tsx(39,2): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/jsx/file.tsx (4 errors) ==== + + declare module JSX { + interface Element { } + interface IntrinsicElements { } + } + + module M { + export class Foo { constructor() { } } + export module S { + export class Bar { } + + // Emit Foo + // Foo, ; + } + } + + module M { + // Emit M.Foo + Foo, ; + ~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + + export module S { + // Emit M.Foo + Foo, ; + ~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + + // Emit S.Bar + Bar, ; + ~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + } + + } + + module M { + // Emit M.S.Bar + S.Bar, ; + } + + module M { + var M = 100; + // Emit M_1.Foo + Foo, ; + ~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + } + \ No newline at end of file diff --git a/tests/baselines/reference/typecheckCommaExpression.errors.txt b/tests/baselines/reference/typecheckCommaExpression.errors.txt index 96c9d4be45c..349236d12d7 100644 --- a/tests/baselines/reference/typecheckCommaExpression.errors.txt +++ b/tests/baselines/reference/typecheckCommaExpression.errors.txt @@ -1,10 +1,13 @@ tests/cases/compiler/typecheckCommaExpression.ts(1,2): error TS2304: Cannot find name 'a'. +tests/cases/compiler/typecheckCommaExpression.ts(1,2): error TS2693: Left side of comma operator is unused and has no side effects. tests/cases/compiler/typecheckCommaExpression.ts(1,5): error TS2304: Cannot find name 'b'. -==== tests/cases/compiler/typecheckCommaExpression.ts (2 errors) ==== +==== tests/cases/compiler/typecheckCommaExpression.ts (3 errors) ==== (a, b) ~ !!! error TS2304: Cannot find name 'a'. + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. ~ !!! error TS2304: Cannot find name 'b'. \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt b/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt index f9394c622c0..c11047330c4 100644 --- a/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithAnyOtherType.errors.txt @@ -1,6 +1,7 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(46,32): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(47,32): error TS2365: Operator '+' cannot be applied to types 'null' and 'null'. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(48,32): error TS2365: Operator '+' cannot be applied to types 'undefined' and 'undefined'. +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(58,1): error TS2693: Left side of comma operator is unused and has no side effects. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(68,1): error TS7028: Unused label. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(69,1): error TS7028: Unused label. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(70,1): error TS7028: Unused label. @@ -10,7 +11,7 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts(74,1): error TS7028: Unused label. -==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts (10 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithAnyOtherType.ts (11 errors) ==== // typeof operator on any type var ANY: any; @@ -75,6 +76,8 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator typeof ANY1; typeof ANY2[0]; typeof ANY, ANY1; + ~~~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. typeof obj1; typeof obj1.x; typeof objA.a; diff --git a/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt b/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt new file mode 100644 index 00000000000..b6e33e440f1 --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithBooleanType.errors.txt @@ -0,0 +1,57 @@ +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts(37,1): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithBooleanType.ts (1 errors) ==== + + // typeof operator on boolean type + var BOOLEAN: boolean; + + function foo(): boolean { return true; } + + class A { + public a: boolean; + static foo() { return false; } + } + module M { + export var n: boolean; + } + + var objA = new A(); + + // boolean type var + var ResultIsString1 = typeof BOOLEAN; + + // boolean type literal + var ResultIsString2 = typeof true; + var ResultIsString3 = typeof { x: true, y: false }; + + // boolean type expressions + var ResultIsString4 = typeof objA.a; + var ResultIsString5 = typeof M.n; + var ResultIsString6 = typeof foo(); + var ResultIsString7 = typeof A.foo(); + + // multiple typeof operator + var ResultIsString8 = typeof typeof BOOLEAN; + + // miss assignment operators + typeof true; + typeof BOOLEAN; + typeof foo(); + typeof true, false; + ~~~~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + typeof objA.a; + typeof M.n; + + // use typeof in type query + var z: boolean; + var x: boolean[]; + var r: () => boolean; + z: typeof BOOLEAN; + r: typeof foo; + var y = { a: true, b: false}; + z: typeof y.a; + z: typeof objA.a; + z: typeof A.foo; + z: typeof M.n; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt b/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt new file mode 100644 index 00000000000..c7291544b1e --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithEnumType.errors.txt @@ -0,0 +1,34 @@ +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts(23,1): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithEnumType.ts (1 errors) ==== + + // typeof operator on enum type + + enum ENUM { }; + enum ENUM1 { A, B, "" }; + + // enum type var + var ResultIsString1 = typeof ENUM; + var ResultIsString2 = typeof ENUM1; + + // enum type expressions + var ResultIsString3 = typeof ENUM1["A"]; + var ResultIsString4 = typeof (ENUM[0] + ENUM1["B"]); + + // multiple typeof operators + var ResultIsString5 = typeof typeof ENUM; + var ResultIsString6 = typeof typeof typeof (ENUM[0] + ENUM1.B); + + // miss assignment operators + typeof ENUM; + typeof ENUM1; + typeof ENUM1["B"]; + typeof ENUM, ENUM1; + ~~~~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + + // use typeof in type query + enum z { }; + z: typeof ENUM; + z: typeof ENUM1; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt b/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt new file mode 100644 index 00000000000..e5604e1efd8 --- /dev/null +++ b/tests/baselines/reference/typeofOperatorWithNumberType.errors.txt @@ -0,0 +1,63 @@ +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts(45,1): error TS2693: Left side of comma operator is unused and has no side effects. + + +==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithNumberType.ts (1 errors) ==== + // typeof operator on number type + var NUMBER: number; + var NUMBER1: number[] = [1, 2]; + + function foo(): number { return 1; } + + class A { + public a: number; + static foo() { return 1; } + } + module M { + export var n: number; + } + + var objA = new A(); + + // number type var + var ResultIsString1 = typeof NUMBER; + var ResultIsString2 = typeof NUMBER1; + + // number type literal + var ResultIsString3 = typeof 1; + var ResultIsString4 = typeof { x: 1, y: 2}; + var ResultIsString5 = typeof { x: 1, y: (n: number) => { return n; } }; + + // number type expressions + var ResultIsString6 = typeof objA.a; + var ResultIsString7 = typeof M.n; + var ResultIsString8 = typeof NUMBER1[0]; + var ResultIsString9 = typeof foo(); + var ResultIsString10 = typeof A.foo(); + var ResultIsString11 = typeof (NUMBER + NUMBER); + + // multiple typeof operators + var ResultIsString12 = typeof typeof NUMBER; + var ResultIsString13 = typeof typeof typeof (NUMBER + NUMBER); + + // miss assignment operators + typeof 1; + typeof NUMBER; + typeof NUMBER1; + typeof foo(); + typeof objA.a; + typeof M.n; + typeof objA.a, M.n; + ~~~~~~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + + // use typeof in type query + var z: number; + var x: number[]; + z: typeof NUMBER; + x: typeof NUMBER1; + r: typeof foo; + var y = { a: 1, b: 2 }; + z: typeof y.a; + z: typeof objA.a; + z: typeof A.foo; + z: typeof M.n; \ No newline at end of file diff --git a/tests/baselines/reference/typeofOperatorWithStringType.errors.txt b/tests/baselines/reference/typeofOperatorWithStringType.errors.txt index bd891c949a3..867703e47c3 100644 --- a/tests/baselines/reference/typeofOperatorWithStringType.errors.txt +++ b/tests/baselines/reference/typeofOperatorWithStringType.errors.txt @@ -1,3 +1,4 @@ +tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(44,1): error TS2693: Left side of comma operator is unused and has no side effects. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(50,1): error TS7028: Unused label. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(51,1): error TS7028: Unused label. tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(52,1): error TS7028: Unused label. @@ -7,7 +8,7 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts(57,1): error TS7028: Unused label. -==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts (7 errors) ==== +==== tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperatorWithStringType.ts (8 errors) ==== // typeof operator on string type var STRING: string; var STRING1: string[] = ["", "abc"]; @@ -52,6 +53,8 @@ tests/cases/conformance/expressions/unaryOperators/typeofOperator/typeofOperator typeof STRING1; typeof foo(); typeof objA.a, M.n; + ~~~~~~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. // use typeof in type query var z: string; diff --git a/tests/baselines/reference/widenedTypes.errors.txt b/tests/baselines/reference/widenedTypes.errors.txt index bca850b9178..e4bc3e70dff 100644 --- a/tests/baselines/reference/widenedTypes.errors.txt +++ b/tests/baselines/reference/widenedTypes.errors.txt @@ -2,6 +2,7 @@ tests/cases/compiler/widenedTypes.ts(2,1): error TS2358: The left-hand side of a tests/cases/compiler/widenedTypes.ts(5,1): error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'. tests/cases/compiler/widenedTypes.ts(6,7): error TS2361: The right-hand side of an 'in' expression must be of type 'any', an object type or a type parameter tests/cases/compiler/widenedTypes.ts(8,15): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. +tests/cases/compiler/widenedTypes.ts(10,14): error TS2693: Left side of comma operator is unused and has no side effects. tests/cases/compiler/widenedTypes.ts(11,1): error TS2322: Type '""' is not assignable to type 'number'. tests/cases/compiler/widenedTypes.ts(18,1): error TS2322: Type '""' is not assignable to type 'number'. tests/cases/compiler/widenedTypes.ts(23,5): error TS2322: Type 'number[]' is not assignable to type 'string[]'. @@ -11,7 +12,7 @@ tests/cases/compiler/widenedTypes.ts(24,5): error TS2322: Type '{ x: number; y: Type 'number' is not assignable to type 'string'. -==== tests/cases/compiler/widenedTypes.ts (8 errors) ==== +==== tests/cases/compiler/widenedTypes.ts (9 errors) ==== null instanceof (() => { }); ~~~~ @@ -30,6 +31,8 @@ tests/cases/compiler/widenedTypes.ts(24,5): error TS2322: Type '{ x: number; y: !!! error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter. var t = [3, (3, null)]; + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. t[3] = ""; ~~~~ !!! error TS2322: Type '""' is not assignable to type 'number'. diff --git a/tests/baselines/reference/witness.errors.txt b/tests/baselines/reference/witness.errors.txt index b60e685e3dd..420298f5e45 100644 --- a/tests/baselines/reference/witness.errors.txt +++ b/tests/baselines/reference/witness.errors.txt @@ -1,5 +1,11 @@ tests/cases/conformance/types/witness/witness.ts(8,21): error TS2372: Parameter 'pInit' cannot be referenced in its initializer. +tests/cases/conformance/types/witness/witness.ts(32,12): error TS2693: Left side of comma operator is unused and has no side effects. tests/cases/conformance/types/witness/witness.ts(33,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'co1' must be of type 'any', but here has type 'number'. +tests/cases/conformance/types/witness/witness.ts(34,12): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/witness/witness.ts(34,12): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/witness/witness.ts(36,12): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/witness/witness.ts(36,12): error TS2693: Left side of comma operator is unused and has no side effects. +tests/cases/conformance/types/witness/witness.ts(36,12): error TS2693: Left side of comma operator is unused and has no side effects. tests/cases/conformance/types/witness/witness.ts(37,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'co3' must be of type 'any', but here has type 'number'. tests/cases/conformance/types/witness/witness.ts(41,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'as1' must be of type 'any', but here has type 'number'. tests/cases/conformance/types/witness/witness.ts(43,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'as2' must be of type 'any', but here has type 'number'. @@ -8,7 +14,7 @@ tests/cases/conformance/types/witness/witness.ts(61,5): error TS2403: Subsequent tests/cases/conformance/types/witness/witness.ts(114,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'propAcc1' must be of type 'any', but here has type '{ m: any; }'. -==== tests/cases/conformance/types/witness/witness.ts (8 errors) ==== +==== tests/cases/conformance/types/witness/witness.ts (14 errors) ==== @@ -43,12 +49,24 @@ tests/cases/conformance/types/witness/witness.ts(114,5): error TS2403: Subsequen // Comma var co1 = (co1, 3); + ~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. var co1: number; ~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'co1' must be of type 'any', but here has type 'number'. var co2 = (3, 4, co2); + ~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + ~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. var co2: any; var co3 = (co1, co2, co3, co1); + ~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + ~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. + ~~~~~~~~~~~~~ +!!! error TS2693: Left side of comma operator is unused and has no side effects. var co3: number; ~~~ !!! error TS2403: Subsequent variable declarations must have the same type. Variable 'co3' must be of type 'any', but here has type 'number'.