diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 5a1871ab9ca..7421288396b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -23728,7 +23728,14 @@ namespace ts { if (assignmentKind) { if (!(localOrExportSymbol.flags & SymbolFlags.Variable) && !(isInJSFile(node) && localOrExportSymbol.flags & SymbolFlags.ValueModule)) { - error(node, Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable, symbolToString(symbol)); + const assignmentError = localOrExportSymbol.flags & SymbolFlags.Enum ? Diagnostics.Cannot_assign_to_0_because_it_is_an_enum + : localOrExportSymbol.flags & SymbolFlags.Class ? Diagnostics.Cannot_assign_to_0_because_it_is_a_class + : localOrExportSymbol.flags & SymbolFlags.Module ? Diagnostics.Cannot_assign_to_0_because_it_is_a_namespace + : localOrExportSymbol.flags & SymbolFlags.Function ? Diagnostics.Cannot_assign_to_0_because_it_is_a_function + : localOrExportSymbol.flags & SymbolFlags.Alias ? Diagnostics.Cannot_assign_to_0_because_it_is_an_import + : Diagnostics.Cannot_assign_to_0_because_it_is_not_a_variable; + + error(node, assignmentError, symbolToString(symbol)); return errorType; } if (isReadonlySymbol(localOrExportSymbol)) { diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 0744d85cf1b..789f7d167d7 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2654,6 +2654,26 @@ "category": "Error", "code": 2627 }, + "Cannot assign to '{0}' because it is an enum.": { + "category": "Error", + "code": 2628 + }, + "Cannot assign to '{0}' because it is a class.": { + "category": "Error", + "code": 2629 + }, + "Cannot assign to '{0}' because it is a function.": { + "category": "Error", + "code": 2630 + }, + "Cannot assign to '{0}' because it is a namespace.": { + "category": "Error", + "code": 2631 + }, + "Cannot assign to '{0}' because it is an import.": { + "category": "Error", + "code": 2632 + }, "Cannot augment module '{0}' with value exports because it resolves to a non-module entity.": { "category": "Error", diff --git a/tests/baselines/reference/arithAssignTyping.errors.txt b/tests/baselines/reference/arithAssignTyping.errors.txt index 12b5b52698d..143ad5cdaf8 100644 --- a/tests/baselines/reference/arithAssignTyping.errors.txt +++ b/tests/baselines/reference/arithAssignTyping.errors.txt @@ -1,15 +1,15 @@ -tests/cases/compiler/arithAssignTyping.ts(3,1): error TS2539: Cannot assign to 'f' because it is not a variable. -tests/cases/compiler/arithAssignTyping.ts(4,1): error TS2539: Cannot assign to 'f' because it is not a variable. -tests/cases/compiler/arithAssignTyping.ts(5,1): error TS2539: Cannot assign to 'f' because it is not a variable. -tests/cases/compiler/arithAssignTyping.ts(6,1): error TS2539: Cannot assign to 'f' because it is not a variable. -tests/cases/compiler/arithAssignTyping.ts(7,1): error TS2539: Cannot assign to 'f' because it is not a variable. -tests/cases/compiler/arithAssignTyping.ts(8,1): error TS2539: Cannot assign to 'f' because it is not a variable. -tests/cases/compiler/arithAssignTyping.ts(9,1): error TS2539: Cannot assign to 'f' because it is not a variable. -tests/cases/compiler/arithAssignTyping.ts(10,1): error TS2539: Cannot assign to 'f' because it is not a variable. -tests/cases/compiler/arithAssignTyping.ts(11,1): error TS2539: Cannot assign to 'f' because it is not a variable. -tests/cases/compiler/arithAssignTyping.ts(12,1): error TS2539: Cannot assign to 'f' because it is not a variable. -tests/cases/compiler/arithAssignTyping.ts(13,1): error TS2539: Cannot assign to 'f' because it is not a variable. -tests/cases/compiler/arithAssignTyping.ts(14,1): error TS2539: Cannot assign to 'f' because it is not a variable. +tests/cases/compiler/arithAssignTyping.ts(3,1): error TS2629: Cannot assign to 'f' because it is a class. +tests/cases/compiler/arithAssignTyping.ts(4,1): error TS2629: Cannot assign to 'f' because it is a class. +tests/cases/compiler/arithAssignTyping.ts(5,1): error TS2629: Cannot assign to 'f' because it is a class. +tests/cases/compiler/arithAssignTyping.ts(6,1): error TS2629: Cannot assign to 'f' because it is a class. +tests/cases/compiler/arithAssignTyping.ts(7,1): error TS2629: Cannot assign to 'f' because it is a class. +tests/cases/compiler/arithAssignTyping.ts(8,1): error TS2629: Cannot assign to 'f' because it is a class. +tests/cases/compiler/arithAssignTyping.ts(9,1): error TS2629: Cannot assign to 'f' because it is a class. +tests/cases/compiler/arithAssignTyping.ts(10,1): error TS2629: Cannot assign to 'f' because it is a class. +tests/cases/compiler/arithAssignTyping.ts(11,1): error TS2629: Cannot assign to 'f' because it is a class. +tests/cases/compiler/arithAssignTyping.ts(12,1): error TS2629: Cannot assign to 'f' because it is a class. +tests/cases/compiler/arithAssignTyping.ts(13,1): error TS2629: Cannot assign to 'f' because it is a class. +tests/cases/compiler/arithAssignTyping.ts(14,1): error TS2629: Cannot assign to 'f' because it is a class. ==== tests/cases/compiler/arithAssignTyping.ts (12 errors) ==== @@ -17,37 +17,37 @@ tests/cases/compiler/arithAssignTyping.ts(14,1): error TS2539: Cannot assign to f += ''; // error ~ -!!! error TS2539: Cannot assign to 'f' because it is not a variable. +!!! error TS2629: Cannot assign to 'f' because it is a class. f += 1; // error ~ -!!! error TS2539: Cannot assign to 'f' because it is not a variable. +!!! error TS2629: Cannot assign to 'f' because it is a class. f -= 1; // error ~ -!!! error TS2539: Cannot assign to 'f' because it is not a variable. +!!! error TS2629: Cannot assign to 'f' because it is a class. f *= 1; // error ~ -!!! error TS2539: Cannot assign to 'f' because it is not a variable. +!!! error TS2629: Cannot assign to 'f' because it is a class. f /= 1; // error ~ -!!! error TS2539: Cannot assign to 'f' because it is not a variable. +!!! error TS2629: Cannot assign to 'f' because it is a class. f %= 1; // error ~ -!!! error TS2539: Cannot assign to 'f' because it is not a variable. +!!! error TS2629: Cannot assign to 'f' because it is a class. f &= 1; // error ~ -!!! error TS2539: Cannot assign to 'f' because it is not a variable. +!!! error TS2629: Cannot assign to 'f' because it is a class. f |= 1; // error ~ -!!! error TS2539: Cannot assign to 'f' because it is not a variable. +!!! error TS2629: Cannot assign to 'f' because it is a class. f <<= 1; // error ~ -!!! error TS2539: Cannot assign to 'f' because it is not a variable. +!!! error TS2629: Cannot assign to 'f' because it is a class. f >>= 1; // error ~ -!!! error TS2539: Cannot assign to 'f' because it is not a variable. +!!! error TS2629: Cannot assign to 'f' because it is a class. f >>>= 1; // error ~ -!!! error TS2539: Cannot assign to 'f' because it is not a variable. +!!! error TS2629: Cannot assign to 'f' because it is a class. f ^= 1; // error ~ -!!! error TS2539: Cannot assign to 'f' because it is not a variable. \ No newline at end of file +!!! error TS2629: Cannot assign to 'f' because it is a class. \ No newline at end of file diff --git a/tests/baselines/reference/assignAnyToEveryType.errors.txt b/tests/baselines/reference/assignAnyToEveryType.errors.txt index 86efb0c3019..a1ff42218e3 100644 --- a/tests/baselines/reference/assignAnyToEveryType.errors.txt +++ b/tests/baselines/reference/assignAnyToEveryType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/any/assignAnyToEveryType.ts(41,1): error TS2539: Cannot assign to 'M' because it is not a variable. +tests/cases/conformance/types/any/assignAnyToEveryType.ts(41,1): error TS2631: Cannot assign to 'M' because it is a namespace. ==== tests/cases/conformance/types/any/assignAnyToEveryType.ts (1 errors) ==== @@ -44,7 +44,7 @@ tests/cases/conformance/types/any/assignAnyToEveryType.ts(41,1): error TS2539: C M = x; ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. function k(a: T) { a = x; diff --git a/tests/baselines/reference/assignToEnum.errors.txt b/tests/baselines/reference/assignToEnum.errors.txt index 53b4afc1864..182cc8a5b72 100644 --- a/tests/baselines/reference/assignToEnum.errors.txt +++ b/tests/baselines/reference/assignToEnum.errors.txt @@ -1,5 +1,5 @@ -tests/cases/compiler/assignToEnum.ts(2,1): error TS2539: Cannot assign to 'A' because it is not a variable. -tests/cases/compiler/assignToEnum.ts(3,1): error TS2539: Cannot assign to 'A' because it is not a variable. +tests/cases/compiler/assignToEnum.ts(2,1): error TS2628: Cannot assign to 'A' because it is an enum. +tests/cases/compiler/assignToEnum.ts(3,1): error TS2628: Cannot assign to 'A' because it is an enum. tests/cases/compiler/assignToEnum.ts(4,3): error TS2540: Cannot assign to 'foo' because it is a read-only property. tests/cases/compiler/assignToEnum.ts(5,3): error TS2540: Cannot assign to 'foo' because it is a read-only property. @@ -8,10 +8,10 @@ tests/cases/compiler/assignToEnum.ts(5,3): error TS2540: Cannot assign to 'foo' enum A { foo, bar } A = undefined; // invalid LHS ~ -!!! error TS2539: Cannot assign to 'A' because it is not a variable. +!!! error TS2628: Cannot assign to 'A' because it is an enum. A = A.bar; // invalid LHS ~ -!!! error TS2539: Cannot assign to 'A' because it is not a variable. +!!! error TS2628: Cannot assign to 'A' because it is an enum. A.foo = 1; // invalid LHS ~~~ !!! error TS2540: Cannot assign to 'foo' because it is a read-only property. diff --git a/tests/baselines/reference/assignToExistingClass.errors.txt b/tests/baselines/reference/assignToExistingClass.errors.txt index 5f7faac9e64..20f6cd8823d 100644 --- a/tests/baselines/reference/assignToExistingClass.errors.txt +++ b/tests/baselines/reference/assignToExistingClass.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/assignToExistingClass.ts(8,13): error TS2539: Cannot assign to 'Mocked' because it is not a variable. +tests/cases/compiler/assignToExistingClass.ts(8,13): error TS2629: Cannot assign to 'Mocked' because it is a class. ==== tests/cases/compiler/assignToExistingClass.ts (1 errors) ==== @@ -11,7 +11,7 @@ tests/cases/compiler/assignToExistingClass.ts(8,13): error TS2539: Cannot assign willThrowError() { Mocked = Mocked || function () { // => Error: Invalid left-hand side of assignment expression. ~~~~~~ -!!! error TS2539: Cannot assign to 'Mocked' because it is not a variable. +!!! error TS2629: Cannot assign to 'Mocked' because it is a class. return { myProp: "test" }; }; } diff --git a/tests/baselines/reference/assignmentLHSIsValue.errors.txt b/tests/baselines/reference/assignmentLHSIsValue.errors.txt index 3064d713a12..1cf07b81622 100644 --- a/tests/baselines/reference/assignmentLHSIsValue.errors.txt +++ b/tests/baselines/reference/assignmentLHSIsValue.errors.txt @@ -3,10 +3,10 @@ tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(7 tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(8,21): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(11,18): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(13,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. -tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(17,1): error TS2539: Cannot assign to 'M' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(19,1): error TS2539: Cannot assign to 'C' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(22,1): error TS2539: Cannot assign to 'E' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(24,1): error TS2539: Cannot assign to 'foo' because it is not a variable. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(17,1): error TS2631: Cannot assign to 'M' because it is a namespace. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(19,1): error TS2629: Cannot assign to 'C' because it is a class. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(22,1): error TS2628: Cannot assign to 'E' because it is an enum. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(24,1): error TS2630: Cannot assign to 'foo' because it is a function. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(27,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(28,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(29,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. @@ -23,10 +23,10 @@ tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(5 tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(51,11): error TS1005: ';' expected. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(54,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(57,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. -tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(58,2): error TS2539: Cannot assign to 'M' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(59,2): error TS2539: Cannot assign to 'C' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(60,2): error TS2539: Cannot assign to 'E' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(61,2): error TS2539: Cannot assign to 'foo' because it is not a variable. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(58,2): error TS2631: Cannot assign to 'M' because it is a namespace. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(59,2): error TS2629: Cannot assign to 'C' because it is a class. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(60,2): error TS2628: Cannot assign to 'E' because it is an enum. +tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(61,2): error TS2630: Cannot assign to 'foo' because it is a function. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(62,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(63,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(64,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. @@ -67,20 +67,20 @@ tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(7 module M { export var a; } M = value; ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. C = value; ~ -!!! error TS2539: Cannot assign to 'C' because it is not a variable. +!!! error TS2629: Cannot assign to 'C' because it is a class. enum E { } E = value; ~ -!!! error TS2539: Cannot assign to 'E' because it is not a variable. +!!! error TS2628: Cannot assign to 'E' because it is an enum. foo = value; ~~~ -!!! error TS2539: Cannot assign to 'foo' because it is not a variable. +!!! error TS2630: Cannot assign to 'foo' because it is a function. // literals null = value; @@ -148,16 +148,16 @@ tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(7 !!! error TS2364: The left-hand side of an assignment expression must be a variable or a property access. (M) = value; ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. (C) = value; ~ -!!! error TS2539: Cannot assign to 'C' because it is not a variable. +!!! error TS2629: Cannot assign to 'C' because it is a class. (E) = value; ~ -!!! error TS2539: Cannot assign to 'E' because it is not a variable. +!!! error TS2628: Cannot assign to 'E' because it is an enum. (foo) = value; ~~~ -!!! error TS2539: Cannot assign to 'foo' because it is not a variable. +!!! error TS2630: Cannot assign to 'foo' because it is a function. (null) = value; ~~~~~~ !!! error TS2364: The left-hand side of an assignment expression must be a variable or a property access. diff --git a/tests/baselines/reference/assignmentToFunction.errors.txt b/tests/baselines/reference/assignmentToFunction.errors.txt index 6e9b1b3c6dd..f415d9c79c9 100644 --- a/tests/baselines/reference/assignmentToFunction.errors.txt +++ b/tests/baselines/reference/assignmentToFunction.errors.txt @@ -1,12 +1,12 @@ -tests/cases/compiler/assignmentToFunction.ts(2,1): error TS2539: Cannot assign to 'fn' because it is not a variable. -tests/cases/compiler/assignmentToFunction.ts(8,9): error TS2539: Cannot assign to 'bar' because it is not a variable. +tests/cases/compiler/assignmentToFunction.ts(2,1): error TS2630: Cannot assign to 'fn' because it is a function. +tests/cases/compiler/assignmentToFunction.ts(8,9): error TS2630: Cannot assign to 'bar' because it is a function. ==== tests/cases/compiler/assignmentToFunction.ts (2 errors) ==== function fn() { } fn = () => 3; ~~ -!!! error TS2539: Cannot assign to 'fn' because it is not a variable. +!!! error TS2630: Cannot assign to 'fn' because it is a function. module foo { function xyz() { @@ -14,6 +14,6 @@ tests/cases/compiler/assignmentToFunction.ts(8,9): error TS2539: Cannot assign t } bar = null; ~~~ -!!! error TS2539: Cannot assign to 'bar' because it is not a variable. +!!! error TS2630: Cannot assign to 'bar' because it is a function. } } \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt index 6a031ff6863..51b15bee2aa 100644 --- a/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt +++ b/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt @@ -3,14 +3,14 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(13,1): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(14,1): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(15,1): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(17,1): error TS2539: Cannot assign to 'M' because it is not a variable. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(18,2): error TS2539: Cannot assign to 'M' because it is not a variable. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(25,5): error TS2539: Cannot assign to 'M3' because it is not a variable. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(17,1): error TS2631: Cannot assign to 'M' because it is a namespace. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(18,2): error TS2631: Cannot assign to 'M' because it is a namespace. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(25,5): error TS2631: Cannot assign to 'M3' because it is a namespace. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(31,11): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(32,13): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(33,13): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(37,1): error TS2539: Cannot assign to 'fn' because it is not a variable. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(38,2): error TS2539: Cannot assign to 'fn' because it is not a variable. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(37,1): error TS2630: Cannot assign to 'fn' because it is a function. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(38,2): error TS2630: Cannot assign to 'fn' because it is a function. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(43,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(44,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(48,5): error TS2322: Type 'string' is not assignable to type 'number'. @@ -18,10 +18,10 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(54,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(55,5): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(56,5): error TS2322: Type 'string' is not assignable to type 'number'. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(62,1): error TS2539: Cannot assign to 'E' because it is not a variable. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(63,2): error TS2539: Cannot assign to 'E' because it is not a variable. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(69,1): error TS2539: Cannot assign to 'C' because it is not a variable. -tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(70,2): error TS2539: Cannot assign to 'C' because it is not a variable. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(62,1): error TS2628: Cannot assign to 'E' because it is an enum. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(63,2): error TS2628: Cannot assign to 'E' because it is an enum. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(69,1): error TS2629: Cannot assign to 'C' because it is a class. +tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(70,2): error TS2629: Cannot assign to 'C' because it is a class. ==== tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts (24 errors) ==== @@ -53,10 +53,10 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize M = { y: 3 }; // Error ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. (M) = { y: 3 }; // Error ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. module M2 { export module M3 { @@ -65,7 +65,7 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize M3 = { x: 3 }; // Error ~~ -!!! error TS2539: Cannot assign to 'M3' because it is not a variable. +!!! error TS2631: Cannot assign to 'M3' because it is a namespace. } M2.M3 = { x: 3 }; // OK (M2).M3 = { x: 3 }; // OK @@ -88,10 +88,10 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize function fn() { } fn = () => 3; // Bug 823548: Should be error (fn is not a reference) ~~ -!!! error TS2539: Cannot assign to 'fn' because it is not a variable. +!!! error TS2630: Cannot assign to 'fn' because it is a function. (fn) = () => 3; // Should be error ~~ -!!! error TS2539: Cannot assign to 'fn' because it is not a variable. +!!! error TS2630: Cannot assign to 'fn' because it is a function. function fn2(x: number, y: { t: number }) { x = 3; @@ -131,10 +131,10 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize } E = undefined; // Error ~ -!!! error TS2539: Cannot assign to 'E' because it is not a variable. +!!! error TS2628: Cannot assign to 'E' because it is an enum. (E) = undefined; // Error ~ -!!! error TS2539: Cannot assign to 'E' because it is not a variable. +!!! error TS2628: Cannot assign to 'E' because it is an enum. class C { @@ -142,8 +142,8 @@ tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesize C = undefined; // Error ~ -!!! error TS2539: Cannot assign to 'C' because it is not a variable. +!!! error TS2629: Cannot assign to 'C' because it is a class. (C) = undefined; // Error ~ -!!! error TS2539: Cannot assign to 'C' because it is not a variable. +!!! error TS2629: Cannot assign to 'C' because it is a class. \ No newline at end of file diff --git a/tests/baselines/reference/assignmentToReferenceTypes.errors.txt b/tests/baselines/reference/assignmentToReferenceTypes.errors.txt index 5e42a2e79c6..e283ab6ec9f 100644 --- a/tests/baselines/reference/assignmentToReferenceTypes.errors.txt +++ b/tests/baselines/reference/assignmentToReferenceTypes.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/assignmentToReferenceTypes.ts(5,1): error TS2708: Cannot use namespace 'M' as a value. -tests/cases/compiler/assignmentToReferenceTypes.ts(9,1): error TS2539: Cannot assign to 'C' because it is not a variable. -tests/cases/compiler/assignmentToReferenceTypes.ts(13,1): error TS2539: Cannot assign to 'E' because it is not a variable. -tests/cases/compiler/assignmentToReferenceTypes.ts(16,1): error TS2539: Cannot assign to 'f' because it is not a variable. +tests/cases/compiler/assignmentToReferenceTypes.ts(9,1): error TS2629: Cannot assign to 'C' because it is a class. +tests/cases/compiler/assignmentToReferenceTypes.ts(13,1): error TS2628: Cannot assign to 'E' because it is an enum. +tests/cases/compiler/assignmentToReferenceTypes.ts(16,1): error TS2630: Cannot assign to 'f' because it is a function. ==== tests/cases/compiler/assignmentToReferenceTypes.ts (4 errors) ==== @@ -17,18 +17,18 @@ tests/cases/compiler/assignmentToReferenceTypes.ts(16,1): error TS2539: Cannot a } C = null; ~ -!!! error TS2539: Cannot assign to 'C' because it is not a variable. +!!! error TS2629: Cannot assign to 'C' because it is a class. enum E { } E = null; ~ -!!! error TS2539: Cannot assign to 'E' because it is not a variable. +!!! error TS2628: Cannot assign to 'E' because it is an enum. function f() { } f = null; ~ -!!! error TS2539: Cannot assign to 'f' because it is not a variable. +!!! error TS2630: Cannot assign to 'f' because it is a function. var x = 1; x = null; diff --git a/tests/baselines/reference/assignments.errors.txt b/tests/baselines/reference/assignments.errors.txt index 19cdbd813a6..4d06a2e31dc 100644 --- a/tests/baselines/reference/assignments.errors.txt +++ b/tests/baselines/reference/assignments.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(11,1): error TS2708: Cannot use namespace 'M' as a value. -tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(14,1): error TS2539: Cannot assign to 'C' because it is not a variable. -tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(17,1): error TS2539: Cannot assign to 'E' because it is not a variable. +tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(14,1): error TS2629: Cannot assign to 'C' because it is a class. +tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(17,1): error TS2628: Cannot assign to 'E' because it is an enum. tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(18,3): error TS2540: Cannot assign to 'A' because it is a read-only property. -tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(21,1): error TS2539: Cannot assign to 'fn' because it is not a variable. +tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(21,1): error TS2630: Cannot assign to 'fn' because it is a function. tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(31,1): error TS2693: 'I' only refers to a type, but is being used as a value here. @@ -24,12 +24,12 @@ tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(31,1): er class C { } C = null; // Error ~ -!!! error TS2539: Cannot assign to 'C' because it is not a variable. +!!! error TS2629: Cannot assign to 'C' because it is a class. enum E { A } E = null; // Error ~ -!!! error TS2539: Cannot assign to 'E' because it is not a variable. +!!! error TS2628: Cannot assign to 'E' because it is an enum. E.A = null; // OK per spec, Error per implementation (509581) ~ !!! error TS2540: Cannot assign to 'A' because it is a read-only property. @@ -37,7 +37,7 @@ tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(31,1): er function fn() { } fn = null; // Should be error ~~ -!!! error TS2539: Cannot assign to 'fn' because it is not a variable. +!!! error TS2630: Cannot assign to 'fn' because it is a function. var v; v = null; // OK diff --git a/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt b/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt index 2c22361bfd6..4ccb502f851 100644 --- a/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt +++ b/tests/baselines/reference/compoundAssignmentLHSIsValue.errors.txt @@ -8,14 +8,14 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsVa tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(22,5): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(25,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(26,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(30,1): error TS2539: Cannot assign to 'M' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(31,1): error TS2539: Cannot assign to 'M' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(33,1): error TS2539: Cannot assign to 'C' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(34,1): error TS2539: Cannot assign to 'C' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(37,1): error TS2539: Cannot assign to 'E' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(38,1): error TS2539: Cannot assign to 'E' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(40,1): error TS2539: Cannot assign to 'foo' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(41,1): error TS2539: Cannot assign to 'foo' because it is not a variable. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(30,1): error TS2631: Cannot assign to 'M' because it is a namespace. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(31,1): error TS2631: Cannot assign to 'M' because it is a namespace. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(33,1): error TS2629: Cannot assign to 'C' because it is a class. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(34,1): error TS2629: Cannot assign to 'C' because it is a class. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(37,1): error TS2628: Cannot assign to 'E' because it is an enum. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(38,1): error TS2628: Cannot assign to 'E' because it is an enum. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(40,1): error TS2630: Cannot assign to 'foo' because it is a function. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(41,1): error TS2630: Cannot assign to 'foo' because it is a function. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(44,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(44,1): error TS2531: Object is possibly 'null'. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(45,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. @@ -47,14 +47,14 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsVa tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(92,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(95,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(96,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(97,2): error TS2539: Cannot assign to 'M' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(98,2): error TS2539: Cannot assign to 'M' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(99,2): error TS2539: Cannot assign to 'C' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(100,2): error TS2539: Cannot assign to 'C' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(101,2): error TS2539: Cannot assign to 'E' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(102,2): error TS2539: Cannot assign to 'E' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(103,2): error TS2539: Cannot assign to 'foo' because it is not a variable. -tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(104,2): error TS2539: Cannot assign to 'foo' because it is not a variable. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(97,2): error TS2631: Cannot assign to 'M' because it is a namespace. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(98,2): error TS2631: Cannot assign to 'M' because it is a namespace. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(99,2): error TS2629: Cannot assign to 'C' because it is a class. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(100,2): error TS2629: Cannot assign to 'C' because it is a class. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(101,2): error TS2628: Cannot assign to 'E' because it is an enum. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(102,2): error TS2628: Cannot assign to 'E' because it is an enum. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(103,2): error TS2630: Cannot assign to 'foo' because it is a function. +tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(104,2): error TS2630: Cannot assign to 'foo' because it is a function. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(105,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(105,1): error TS2531: Object is possibly 'null'. tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(106,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. @@ -128,32 +128,32 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsVa module M { export var a; } M *= value; ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. M += value; ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. C *= value; ~ -!!! error TS2539: Cannot assign to 'C' because it is not a variable. +!!! error TS2629: Cannot assign to 'C' because it is a class. C += value; ~ -!!! error TS2539: Cannot assign to 'C' because it is not a variable. +!!! error TS2629: Cannot assign to 'C' because it is a class. enum E { } E *= value; ~ -!!! error TS2539: Cannot assign to 'E' because it is not a variable. +!!! error TS2628: Cannot assign to 'E' because it is an enum. E += value; ~ -!!! error TS2539: Cannot assign to 'E' because it is not a variable. +!!! error TS2628: Cannot assign to 'E' because it is an enum. foo *= value; ~~~ -!!! error TS2539: Cannot assign to 'foo' because it is not a variable. +!!! error TS2630: Cannot assign to 'foo' because it is a function. foo += value; ~~~ -!!! error TS2539: Cannot assign to 'foo' because it is not a variable. +!!! error TS2630: Cannot assign to 'foo' because it is a function. // literals null *= value; @@ -273,28 +273,28 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsVa !!! error TS2364: The left-hand side of an assignment expression must be a variable or a property access. (M) *= value; ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. (M) += value; ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. (C) *= value; ~ -!!! error TS2539: Cannot assign to 'C' because it is not a variable. +!!! error TS2629: Cannot assign to 'C' because it is a class. (C) += value; ~ -!!! error TS2539: Cannot assign to 'C' because it is not a variable. +!!! error TS2629: Cannot assign to 'C' because it is a class. (E) *= value; ~ -!!! error TS2539: Cannot assign to 'E' because it is not a variable. +!!! error TS2628: Cannot assign to 'E' because it is an enum. (E) += value; ~ -!!! error TS2539: Cannot assign to 'E' because it is not a variable. +!!! error TS2628: Cannot assign to 'E' because it is an enum. (foo) *= value; ~~~ -!!! error TS2539: Cannot assign to 'foo' because it is not a variable. +!!! error TS2630: Cannot assign to 'foo' because it is a function. (foo) += value; ~~~ -!!! error TS2539: Cannot assign to 'foo' because it is not a variable. +!!! error TS2630: Cannot assign to 'foo' because it is a function. (null) *= value; ~~~~~~ !!! error TS2364: The left-hand side of an assignment expression must be a variable or a property access. diff --git a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.errors.txt b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.errors.txt index 37e9ca6be1d..395b39a201f 100644 --- a/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.errors.txt +++ b/tests/baselines/reference/compoundExponentiationAssignmentLHSIsValue.errors.txt @@ -3,10 +3,10 @@ tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignm tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(13,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(18,5): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(21,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(25,1): error TS2539: Cannot assign to 'M' because it is not a variable. -tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(27,1): error TS2539: Cannot assign to 'C' because it is not a variable. -tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(30,1): error TS2539: Cannot assign to 'E' because it is not a variable. -tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(32,1): error TS2539: Cannot assign to 'foo' because it is not a variable. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(25,1): error TS2631: Cannot assign to 'M' because it is a namespace. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(27,1): error TS2629: Cannot assign to 'C' because it is a class. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(30,1): error TS2628: Cannot assign to 'E' because it is an enum. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(32,1): error TS2630: Cannot assign to 'foo' because it is a function. tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(35,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(35,1): error TS2531: Object is possibly 'null'. tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(36,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. @@ -23,10 +23,10 @@ tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignm tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(66,11): error TS1005: ';' expected. tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(69,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(72,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. -tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(73,2): error TS2539: Cannot assign to 'M' because it is not a variable. -tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(74,2): error TS2539: Cannot assign to 'C' because it is not a variable. -tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(75,2): error TS2539: Cannot assign to 'E' because it is not a variable. -tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(76,2): error TS2539: Cannot assign to 'foo' because it is not a variable. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(73,2): error TS2631: Cannot assign to 'M' because it is a namespace. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(74,2): error TS2629: Cannot assign to 'C' because it is a class. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(75,2): error TS2628: Cannot assign to 'E' because it is an enum. +tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(76,2): error TS2630: Cannot assign to 'foo' because it is a function. tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(77,1): error TS2364: The left-hand side of an assignment expression must be a variable or a property access. tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(77,1): error TS2531: Object is possibly 'null'. tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignmentLHSIsValue.ts(78,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. @@ -76,20 +76,20 @@ tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignm module M { export var a; } M **= value; ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. C **= value; ~ -!!! error TS2539: Cannot assign to 'C' because it is not a variable. +!!! error TS2629: Cannot assign to 'C' because it is a class. enum E { } E **= value; ~ -!!! error TS2539: Cannot assign to 'E' because it is not a variable. +!!! error TS2628: Cannot assign to 'E' because it is an enum. foo **= value; ~~~ -!!! error TS2539: Cannot assign to 'foo' because it is not a variable. +!!! error TS2630: Cannot assign to 'foo' because it is a function. // literals null **= value; @@ -164,16 +164,16 @@ tests/cases/conformance/es7/exponentiationOperator/compoundExponentiationAssignm !!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. (M) **= value; ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. (C) **= value; ~ -!!! error TS2539: Cannot assign to 'C' because it is not a variable. +!!! error TS2629: Cannot assign to 'C' because it is a class. (E) **= value; ~ -!!! error TS2539: Cannot assign to 'E' because it is not a variable. +!!! error TS2628: Cannot assign to 'E' because it is an enum. (foo) **= value; ~~~ -!!! error TS2539: Cannot assign to 'foo' because it is not a variable. +!!! error TS2630: Cannot assign to 'foo' because it is a function. (null) **= value; ~~~~~~ !!! error TS2364: The left-hand side of an assignment expression must be a variable or a property access. diff --git a/tests/baselines/reference/concatClassAndString.errors.txt b/tests/baselines/reference/concatClassAndString.errors.txt index b0cb54b31c0..9a3b75601cd 100644 --- a/tests/baselines/reference/concatClassAndString.errors.txt +++ b/tests/baselines/reference/concatClassAndString.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/concatClassAndString.ts(4,1): error TS2539: Cannot assign to 'f' because it is not a variable. +tests/cases/compiler/concatClassAndString.ts(4,1): error TS2629: Cannot assign to 'f' because it is a class. ==== tests/cases/compiler/concatClassAndString.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/compiler/concatClassAndString.ts(4,1): error TS2539: Cannot assign t f += ''; ~ -!!! error TS2539: Cannot assign to 'f' because it is not a variable. +!!! error TS2629: Cannot assign to 'f' because it is a class. \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt index 9fb7b43b0d8..fd33f7fa749 100644 --- a/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(24,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(25,25): error TS2539: Cannot assign to 'A' because it is not a variable. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(26,25): error TS2539: Cannot assign to 'M' because it is not a variable. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(25,25): error TS2629: Cannot assign to 'A' because it is a class. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(26,25): error TS2631: Cannot assign to 'M' because it is a namespace. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(27,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(28,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(30,23): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(31,23): error TS2539: Cannot assign to 'A' because it is not a variable. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(32,23): error TS2539: Cannot assign to 'M' because it is not a variable. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(31,23): error TS2629: Cannot assign to 'A' because it is a class. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(32,23): error TS2631: Cannot assign to 'M' because it is a namespace. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(33,23): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(34,24): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithAnyOtherTypeInvalidOperations.ts(37,26): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. @@ -81,10 +81,10 @@ tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOp !!! error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. var ResultIsNumber2 = --A; ~ -!!! error TS2539: Cannot assign to 'A' because it is not a variable. +!!! error TS2629: Cannot assign to 'A' because it is a class. var ResultIsNumber3 = --M; ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. var ResultIsNumber4 = --obj; ~~~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. @@ -97,10 +97,10 @@ tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOp !!! error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. var ResultIsNumber7 = A--; ~ -!!! error TS2539: Cannot assign to 'A' because it is not a variable. +!!! error TS2629: Cannot assign to 'A' because it is a class. var ResultIsNumber8 = M--; ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. var ResultIsNumber9 = obj--; ~~~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. diff --git a/tests/baselines/reference/decrementOperatorWithEnumTypeInvalidOperations.errors.txt b/tests/baselines/reference/decrementOperatorWithEnumTypeInvalidOperations.errors.txt index 0a79432c59c..319bedf2bd5 100644 --- a/tests/baselines/reference/decrementOperatorWithEnumTypeInvalidOperations.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithEnumTypeInvalidOperations.errors.txt @@ -1,15 +1,15 @@ -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(7,25): error TS2539: Cannot assign to 'ENUM' because it is not a variable. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(8,25): error TS2539: Cannot assign to 'ENUM1' because it is not a variable. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(10,23): error TS2539: Cannot assign to 'ENUM' because it is not a variable. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(11,23): error TS2539: Cannot assign to 'ENUM1' because it is not a variable. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(7,25): error TS2628: Cannot assign to 'ENUM' because it is an enum. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(8,25): error TS2628: Cannot assign to 'ENUM1' because it is an enum. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(10,23): error TS2628: Cannot assign to 'ENUM' because it is an enum. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(11,23): error TS2628: Cannot assign to 'ENUM1' because it is an enum. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(14,25): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(14,43): error TS2339: Property 'B' does not exist on type 'typeof ENUM'. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(15,23): error TS2357: The operand of an increment or decrement operator must be a variable or a property access. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(15,29): error TS2339: Property 'A' does not exist on type 'typeof ENUM'. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(18,3): error TS2539: Cannot assign to 'ENUM' because it is not a variable. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(19,3): error TS2539: Cannot assign to 'ENUM1' because it is not a variable. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(21,1): error TS2539: Cannot assign to 'ENUM' because it is not a variable. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(22,1): error TS2539: Cannot assign to 'ENUM1' because it is not a variable. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(18,3): error TS2628: Cannot assign to 'ENUM' because it is an enum. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(19,3): error TS2628: Cannot assign to 'ENUM1' because it is an enum. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(21,1): error TS2628: Cannot assign to 'ENUM' because it is an enum. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts(22,1): error TS2628: Cannot assign to 'ENUM1' because it is an enum. ==== tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumTypeInvalidOperations.ts (12 errors) ==== @@ -21,17 +21,17 @@ tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOp // enum type var var ResultIsNumber1 = --ENUM; ~~~~ -!!! error TS2539: Cannot assign to 'ENUM' because it is not a variable. +!!! error TS2628: Cannot assign to 'ENUM' because it is an enum. var ResultIsNumber2 = --ENUM1; ~~~~~ -!!! error TS2539: Cannot assign to 'ENUM1' because it is not a variable. +!!! error TS2628: Cannot assign to 'ENUM1' because it is an enum. var ResultIsNumber3 = ENUM--; ~~~~ -!!! error TS2539: Cannot assign to 'ENUM' because it is not a variable. +!!! error TS2628: Cannot assign to 'ENUM' because it is an enum. var ResultIsNumber4 = ENUM1--; ~~~~~ -!!! error TS2539: Cannot assign to 'ENUM1' because it is not a variable. +!!! error TS2628: Cannot assign to 'ENUM1' because it is an enum. // enum type expressions var ResultIsNumber5 = --(ENUM["A"] + ENUM.B); @@ -48,14 +48,14 @@ tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOp // miss assignment operator --ENUM; ~~~~ -!!! error TS2539: Cannot assign to 'ENUM' because it is not a variable. +!!! error TS2628: Cannot assign to 'ENUM' because it is an enum. --ENUM1; ~~~~~ -!!! error TS2539: Cannot assign to 'ENUM1' because it is not a variable. +!!! error TS2628: Cannot assign to 'ENUM1' because it is an enum. ENUM--; ~~~~ -!!! error TS2539: Cannot assign to 'ENUM' because it is not a variable. +!!! error TS2628: Cannot assign to 'ENUM' because it is an enum. ENUM1--; ~~~~~ -!!! error TS2539: Cannot assign to 'ENUM1' because it is not a variable. \ No newline at end of file +!!! error TS2628: Cannot assign to 'ENUM1' because it is an enum. \ No newline at end of file diff --git a/tests/baselines/reference/importsImplicitlyReadonly.errors.txt b/tests/baselines/reference/importsImplicitlyReadonly.errors.txt index f760e08f36a..3a85d0bffca 100644 --- a/tests/baselines/reference/importsImplicitlyReadonly.errors.txt +++ b/tests/baselines/reference/importsImplicitlyReadonly.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/externalModules/b.ts(6,1): error TS2539: Cannot assign to 'x' because it is not a variable. -tests/cases/conformance/externalModules/b.ts(7,1): error TS2539: Cannot assign to 'y' because it is not a variable. +tests/cases/conformance/externalModules/b.ts(6,1): error TS2632: Cannot assign to 'x' because it is an import. +tests/cases/conformance/externalModules/b.ts(7,1): error TS2632: Cannot assign to 'y' because it is an import. tests/cases/conformance/externalModules/b.ts(8,4): error TS2540: Cannot assign to 'x' because it is a read-only property. tests/cases/conformance/externalModules/b.ts(9,4): error TS2540: Cannot assign to 'y' because it is a read-only property. @@ -12,10 +12,10 @@ tests/cases/conformance/externalModules/b.ts(9,4): error TS2540: Cannot assign t x = 1; // Error ~ -!!! error TS2539: Cannot assign to 'x' because it is not a variable. +!!! error TS2632: Cannot assign to 'x' because it is an import. y = 1; // Error ~ -!!! error TS2539: Cannot assign to 'y' because it is not a variable. +!!! error TS2632: Cannot assign to 'y' because it is an import. a1.x = 1; // Error ~ !!! error TS2540: Cannot assign to 'x' because it is a read-only property. diff --git a/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt index 5d59f55a55a..953067effca 100644 --- a/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt +++ b/tests/baselines/reference/incrementOperatorWithAnyOtherTypeInvalidOperations.errors.txt @@ -1,11 +1,11 @@ tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(24,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(25,25): error TS2539: Cannot assign to 'A' because it is not a variable. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(26,25): error TS2539: Cannot assign to 'M' because it is not a variable. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(25,25): error TS2629: Cannot assign to 'A' because it is a class. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(26,25): error TS2631: Cannot assign to 'M' because it is a namespace. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(27,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(28,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(30,23): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(31,23): error TS2539: Cannot assign to 'A' because it is not a variable. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(32,23): error TS2539: Cannot assign to 'M' because it is not a variable. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(31,23): error TS2629: Cannot assign to 'A' because it is a class. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(32,23): error TS2631: Cannot assign to 'M' because it is a namespace. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(33,23): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(34,24): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithAnyOtherTypeInvalidOperations.ts(37,26): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. @@ -76,10 +76,10 @@ tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOp !!! error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. var ResultIsNumber2 = ++A; ~ -!!! error TS2539: Cannot assign to 'A' because it is not a variable. +!!! error TS2629: Cannot assign to 'A' because it is a class. var ResultIsNumber3 = ++M; ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. var ResultIsNumber4 = ++obj; ~~~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. @@ -92,10 +92,10 @@ tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOp !!! error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. var ResultIsNumber7 = A++; ~ -!!! error TS2539: Cannot assign to 'A' because it is not a variable. +!!! error TS2629: Cannot assign to 'A' because it is a class. var ResultIsNumber8 = M++; ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. var ResultIsNumber9 = obj++; ~~~ !!! error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. diff --git a/tests/baselines/reference/incrementOperatorWithEnumTypeInvalidOperations.errors.txt b/tests/baselines/reference/incrementOperatorWithEnumTypeInvalidOperations.errors.txt index bf4dcdf2fd6..d5925638cd5 100644 --- a/tests/baselines/reference/incrementOperatorWithEnumTypeInvalidOperations.errors.txt +++ b/tests/baselines/reference/incrementOperatorWithEnumTypeInvalidOperations.errors.txt @@ -1,13 +1,13 @@ -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(7,25): error TS2539: Cannot assign to 'ENUM' because it is not a variable. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(8,25): error TS2539: Cannot assign to 'ENUM1' because it is not a variable. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(10,23): error TS2539: Cannot assign to 'ENUM' because it is not a variable. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(11,23): error TS2539: Cannot assign to 'ENUM1' because it is not a variable. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(7,25): error TS2628: Cannot assign to 'ENUM' because it is an enum. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(8,25): error TS2628: Cannot assign to 'ENUM1' because it is an enum. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(10,23): error TS2628: Cannot assign to 'ENUM' because it is an enum. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(11,23): error TS2628: Cannot assign to 'ENUM1' because it is an enum. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(14,25): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(15,23): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(18,3): error TS2539: Cannot assign to 'ENUM' because it is not a variable. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(19,3): error TS2539: Cannot assign to 'ENUM1' because it is not a variable. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(21,1): error TS2539: Cannot assign to 'ENUM' because it is not a variable. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(22,1): error TS2539: Cannot assign to 'ENUM1' because it is not a variable. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(18,3): error TS2628: Cannot assign to 'ENUM' because it is an enum. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(19,3): error TS2628: Cannot assign to 'ENUM1' because it is an enum. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(21,1): error TS2628: Cannot assign to 'ENUM' because it is an enum. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts(22,1): error TS2628: Cannot assign to 'ENUM1' because it is an enum. ==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumTypeInvalidOperations.ts (10 errors) ==== @@ -19,17 +19,17 @@ tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOp // enum type var var ResultIsNumber1 = ++ENUM; ~~~~ -!!! error TS2539: Cannot assign to 'ENUM' because it is not a variable. +!!! error TS2628: Cannot assign to 'ENUM' because it is an enum. var ResultIsNumber2 = ++ENUM1; ~~~~~ -!!! error TS2539: Cannot assign to 'ENUM1' because it is not a variable. +!!! error TS2628: Cannot assign to 'ENUM1' because it is an enum. var ResultIsNumber3 = ENUM++; ~~~~ -!!! error TS2539: Cannot assign to 'ENUM' because it is not a variable. +!!! error TS2628: Cannot assign to 'ENUM' because it is an enum. var ResultIsNumber4 = ENUM1++; ~~~~~ -!!! error TS2539: Cannot assign to 'ENUM1' because it is not a variable. +!!! error TS2628: Cannot assign to 'ENUM1' because it is an enum. // enum type expressions var ResultIsNumber5 = ++(ENUM[1] + ENUM[2]); @@ -42,14 +42,14 @@ tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOp // miss assignment operator ++ENUM; ~~~~ -!!! error TS2539: Cannot assign to 'ENUM' because it is not a variable. +!!! error TS2628: Cannot assign to 'ENUM' because it is an enum. ++ENUM1; ~~~~~ -!!! error TS2539: Cannot assign to 'ENUM1' because it is not a variable. +!!! error TS2628: Cannot assign to 'ENUM1' because it is an enum. ENUM++; ~~~~ -!!! error TS2539: Cannot assign to 'ENUM' because it is not a variable. +!!! error TS2628: Cannot assign to 'ENUM' because it is an enum. ENUM1++; ~~~~~ -!!! error TS2539: Cannot assign to 'ENUM1' because it is not a variable. \ No newline at end of file +!!! error TS2628: Cannot assign to 'ENUM1' because it is an enum. \ No newline at end of file diff --git a/tests/baselines/reference/invalidBooleanAssignments.errors.txt b/tests/baselines/reference/invalidBooleanAssignments.errors.txt index 5e1b0c49531..653aa07ddb3 100644 --- a/tests/baselines/reference/invalidBooleanAssignments.errors.txt +++ b/tests/baselines/reference/invalidBooleanAssignments.errors.txt @@ -5,10 +5,10 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(9, tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(12,5): error TS2322: Type 'boolean' is not assignable to type 'C'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(15,5): error TS2322: Type 'boolean' is not assignable to type 'I'. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(17,5): error TS2322: Type 'boolean' is not assignable to type '() => string'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(21,1): error TS2539: Cannot assign to 'M' because it is not a variable. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(21,1): error TS2631: Cannot assign to 'M' because it is a namespace. tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(24,5): error TS2322: Type 'boolean' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'boolean'. -tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26,1): error TS2539: Cannot assign to 'i' because it is not a variable. +tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26,1): error TS2630: Cannot assign to 'i' because it is a function. ==== tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts (10 errors) ==== @@ -48,7 +48,7 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26 module M { export var a = 1; } M = x; ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. function i(a: T) { a = x; @@ -58,4 +58,4 @@ tests/cases/conformance/types/primitives/boolean/invalidBooleanAssignments.ts(26 } i = x; ~ -!!! error TS2539: Cannot assign to 'i' because it is not a variable. \ No newline at end of file +!!! error TS2630: Cannot assign to 'i' because it is a function. \ No newline at end of file diff --git a/tests/baselines/reference/invalidNumberAssignments.errors.txt b/tests/baselines/reference/invalidNumberAssignments.errors.txt index 3326e2af122..7b88648aae2 100644 --- a/tests/baselines/reference/invalidNumberAssignments.errors.txt +++ b/tests/baselines/reference/invalidNumberAssignments.errors.txt @@ -5,10 +5,10 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(9,5) tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(12,5): error TS2322: Type 'number' is not assignable to type 'I'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(18,1): error TS2539: Cannot assign to 'M' because it is not a variable. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(18,1): error TS2631: Cannot assign to 'M' because it is a namespace. tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(21,5): error TS2322: Type 'number' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'number'. -tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1): error TS2539: Cannot assign to 'i' because it is not a variable. +tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1): error TS2630: Cannot assign to 'i' because it is a function. ==== tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts (10 errors) ==== @@ -45,7 +45,7 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1 module M { export var x = 1; } M = x; ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. function i(a: T) { a = x; @@ -55,4 +55,4 @@ tests/cases/conformance/types/primitives/number/invalidNumberAssignments.ts(23,1 } i = x; ~ -!!! error TS2539: Cannot assign to 'i' because it is not a variable. \ No newline at end of file +!!! error TS2630: Cannot assign to 'i' because it is a function. \ No newline at end of file diff --git a/tests/baselines/reference/invalidStringAssignments.errors.txt b/tests/baselines/reference/invalidStringAssignments.errors.txt index 9c586858f6a..d2898294bdd 100644 --- a/tests/baselines/reference/invalidStringAssignments.errors.txt +++ b/tests/baselines/reference/invalidStringAssignments.errors.txt @@ -5,10 +5,10 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(9,5) tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(12,5): error TS2322: Type 'string' is not assignable to type 'I'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(18,1): error TS2539: Cannot assign to 'M' because it is not a variable. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(18,1): error TS2631: Cannot assign to 'M' because it is a namespace. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(21,5): error TS2322: Type 'string' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'string'. -tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(23,1): error TS2539: Cannot assign to 'i' because it is not a variable. +tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(23,1): error TS2630: Cannot assign to 'i' because it is a function. tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5): error TS2322: Type 'string' is not assignable to type 'E'. @@ -46,7 +46,7 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5 module M { export var x = 1; } M = x; ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. function i(a: T) { a = x; @@ -56,7 +56,7 @@ tests/cases/conformance/types/primitives/string/invalidStringAssignments.ts(26,5 } i = x; ~ -!!! error TS2539: Cannot assign to 'i' because it is not a variable. +!!! error TS2630: Cannot assign to 'i' because it is a function. enum E { A } var j: E = x; diff --git a/tests/baselines/reference/invalidUndefinedAssignments.errors.txt b/tests/baselines/reference/invalidUndefinedAssignments.errors.txt index 223835f2027..a09b4c77bc5 100644 --- a/tests/baselines/reference/invalidUndefinedAssignments.errors.txt +++ b/tests/baselines/reference/invalidUndefinedAssignments.errors.txt @@ -1,9 +1,9 @@ -tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(4,1): error TS2539: Cannot assign to 'E' because it is not a variable. +tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(4,1): error TS2628: Cannot assign to 'E' because it is an enum. tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(5,3): error TS2540: Cannot assign to 'A' because it is a read-only property. -tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(9,1): error TS2539: Cannot assign to 'C' because it is not a variable. +tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(9,1): error TS2629: Cannot assign to 'C' because it is a class. tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(14,1): error TS2693: 'I' only refers to a type, but is being used as a value here. -tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(17,1): error TS2539: Cannot assign to 'M' because it is not a variable. -tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(21,1): error TS2539: Cannot assign to 'i' because it is not a variable. +tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(17,1): error TS2631: Cannot assign to 'M' because it is a namespace. +tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts(21,1): error TS2630: Cannot assign to 'i' because it is a function. ==== tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.ts (6 errors) ==== @@ -12,7 +12,7 @@ tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.t enum E { A } E = x; ~ -!!! error TS2539: Cannot assign to 'E' because it is not a variable. +!!! error TS2628: Cannot assign to 'E' because it is an enum. E.A = x; ~ !!! error TS2540: Cannot assign to 'A' because it is a read-only property. @@ -21,7 +21,7 @@ tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.t var f: C; C = x; ~ -!!! error TS2539: Cannot assign to 'C' because it is not a variable. +!!! error TS2629: Cannot assign to 'C' because it is a class. interface I { foo: string } var g: I; @@ -33,10 +33,10 @@ tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.t module M { export var x = 1; } M = x; ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. function i(a: T) { } // BUG 767030 i = x; ~ -!!! error TS2539: Cannot assign to 'i' because it is not a variable. \ No newline at end of file +!!! error TS2630: Cannot assign to 'i' because it is a function. \ No newline at end of file diff --git a/tests/baselines/reference/invalidVoidAssignments.errors.txt b/tests/baselines/reference/invalidVoidAssignments.errors.txt index 3e368471827..4a52e63e0e9 100644 --- a/tests/baselines/reference/invalidVoidAssignments.errors.txt +++ b/tests/baselines/reference/invalidVoidAssignments.errors.txt @@ -5,10 +5,10 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(9,5): er tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(12,5): error TS2322: Type 'void' is not assignable to type 'I'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(14,5): error TS2322: Type 'number' is not assignable to type '{ baz: string; }'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(15,5): error TS2322: Type 'number' is not assignable to type '{ 0: number; }'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(18,1): error TS2539: Cannot assign to 'M' because it is not a variable. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(18,1): error TS2631: Cannot assign to 'M' because it is a namespace. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(21,5): error TS2322: Type 'void' is not assignable to type 'T'. 'T' could be instantiated with an arbitrary type which could be unrelated to 'void'. -tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(23,1): error TS2539: Cannot assign to 'i' because it is not a variable. +tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(23,1): error TS2630: Cannot assign to 'i' because it is a function. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(26,1): error TS2322: Type 'typeof E' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(27,1): error TS2322: Type 'E' is not assignable to type 'void'. tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): error TS2322: Type '{ f(): void; }' is not assignable to type 'void'. @@ -48,7 +48,7 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): e module M { export var x = 1; } M = x; ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. function i(a: T) { a = x; @@ -58,7 +58,7 @@ tests/cases/conformance/types/primitives/void/invalidVoidAssignments.ts(29,1): e } i = x; ~ -!!! error TS2539: Cannot assign to 'i' because it is not a variable. +!!! error TS2630: Cannot assign to 'i' because it is a function. enum E { A } x = E; diff --git a/tests/baselines/reference/parserStrictMode3-negative.errors.txt b/tests/baselines/reference/parserStrictMode3-negative.errors.txt index 4ea779d5fdc..d4ed9421406 100644 --- a/tests/baselines/reference/parserStrictMode3-negative.errors.txt +++ b/tests/baselines/reference/parserStrictMode3-negative.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode3-negative.ts(1,1): error TS2539: Cannot assign to 'eval' because it is not a variable. +tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode3-negative.ts(1,1): error TS2630: Cannot assign to 'eval' because it is a function. ==== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode3-negative.ts (1 errors) ==== eval = 1; ~~~~ -!!! error TS2539: Cannot assign to 'eval' because it is not a variable. \ No newline at end of file +!!! error TS2630: Cannot assign to 'eval' because it is a function. \ No newline at end of file diff --git a/tests/baselines/reference/parserStrictMode3.errors.txt b/tests/baselines/reference/parserStrictMode3.errors.txt index 688aa6e462b..6eac51b493d 100644 --- a/tests/baselines/reference/parserStrictMode3.errors.txt +++ b/tests/baselines/reference/parserStrictMode3.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode3.ts(2,1): error TS1100: Invalid use of 'eval' in strict mode. -tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode3.ts(2,1): error TS2539: Cannot assign to 'eval' because it is not a variable. +tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode3.ts(2,1): error TS2630: Cannot assign to 'eval' because it is a function. ==== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode3.ts (2 errors) ==== @@ -8,4 +8,4 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode3.ts(2,1): ~~~~ !!! error TS1100: Invalid use of 'eval' in strict mode. ~~~~ -!!! error TS2539: Cannot assign to 'eval' because it is not a variable. \ No newline at end of file +!!! error TS2630: Cannot assign to 'eval' because it is a function. \ No newline at end of file diff --git a/tests/baselines/reference/parserStrictMode5.errors.txt b/tests/baselines/reference/parserStrictMode5.errors.txt index d3b0ab3f44a..61534195b6e 100644 --- a/tests/baselines/reference/parserStrictMode5.errors.txt +++ b/tests/baselines/reference/parserStrictMode5.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode5.ts(2,1): error TS1100: Invalid use of 'eval' in strict mode. -tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode5.ts(2,1): error TS2539: Cannot assign to 'eval' because it is not a variable. +tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode5.ts(2,1): error TS2630: Cannot assign to 'eval' because it is a function. ==== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode5.ts (2 errors) ==== @@ -8,4 +8,4 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode5.ts(2,1): ~~~~ !!! error TS1100: Invalid use of 'eval' in strict mode. ~~~~ -!!! error TS2539: Cannot assign to 'eval' because it is not a variable. \ No newline at end of file +!!! error TS2630: Cannot assign to 'eval' because it is a function. \ No newline at end of file diff --git a/tests/baselines/reference/parserStrictMode6-negative.errors.txt b/tests/baselines/reference/parserStrictMode6-negative.errors.txt index df373be0301..64c3c6bdb1d 100644 --- a/tests/baselines/reference/parserStrictMode6-negative.errors.txt +++ b/tests/baselines/reference/parserStrictMode6-negative.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode6-negative.ts(1,1): error TS2539: Cannot assign to 'eval' because it is not a variable. +tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode6-negative.ts(1,1): error TS2630: Cannot assign to 'eval' because it is a function. ==== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode6-negative.ts (1 errors) ==== eval++; ~~~~ -!!! error TS2539: Cannot assign to 'eval' because it is not a variable. \ No newline at end of file +!!! error TS2630: Cannot assign to 'eval' because it is a function. \ No newline at end of file diff --git a/tests/baselines/reference/parserStrictMode6.errors.txt b/tests/baselines/reference/parserStrictMode6.errors.txt index 2a8fda7f62f..03cf2159b81 100644 --- a/tests/baselines/reference/parserStrictMode6.errors.txt +++ b/tests/baselines/reference/parserStrictMode6.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode6.ts(2,1): error TS1100: Invalid use of 'eval' in strict mode. -tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode6.ts(2,1): error TS2539: Cannot assign to 'eval' because it is not a variable. +tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode6.ts(2,1): error TS2630: Cannot assign to 'eval' because it is a function. ==== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode6.ts (2 errors) ==== @@ -8,4 +8,4 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode6.ts(2,1): ~~~~ !!! error TS1100: Invalid use of 'eval' in strict mode. ~~~~ -!!! error TS2539: Cannot assign to 'eval' because it is not a variable. \ No newline at end of file +!!! error TS2630: Cannot assign to 'eval' because it is a function. \ No newline at end of file diff --git a/tests/baselines/reference/parserStrictMode7.errors.txt b/tests/baselines/reference/parserStrictMode7.errors.txt index b4ea09f14d4..c98859e749d 100644 --- a/tests/baselines/reference/parserStrictMode7.errors.txt +++ b/tests/baselines/reference/parserStrictMode7.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode7.ts(2,3): error TS1100: Invalid use of 'eval' in strict mode. -tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode7.ts(2,3): error TS2539: Cannot assign to 'eval' because it is not a variable. +tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode7.ts(2,3): error TS2630: Cannot assign to 'eval' because it is a function. ==== tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode7.ts (2 errors) ==== @@ -8,4 +8,4 @@ tests/cases/conformance/parser/ecmascript5/StrictMode/parserStrictMode7.ts(2,3): ~~~~ !!! error TS1100: Invalid use of 'eval' in strict mode. ~~~~ -!!! error TS2539: Cannot assign to 'eval' because it is not a variable. \ No newline at end of file +!!! error TS2630: Cannot assign to 'eval' because it is a function. \ No newline at end of file diff --git a/tests/baselines/reference/unaryOperatorsInStrictMode.errors.txt b/tests/baselines/reference/unaryOperatorsInStrictMode.errors.txt index 35963c05879..12cf93dec02 100644 --- a/tests/baselines/reference/unaryOperatorsInStrictMode.errors.txt +++ b/tests/baselines/reference/unaryOperatorsInStrictMode.errors.txt @@ -1,15 +1,15 @@ tests/cases/compiler/unaryOperatorsInStrictMode.ts(3,3): error TS1100: Invalid use of 'eval' in strict mode. -tests/cases/compiler/unaryOperatorsInStrictMode.ts(3,3): error TS2539: Cannot assign to 'eval' because it is not a variable. +tests/cases/compiler/unaryOperatorsInStrictMode.ts(3,3): error TS2630: Cannot assign to 'eval' because it is a function. tests/cases/compiler/unaryOperatorsInStrictMode.ts(4,3): error TS1100: Invalid use of 'eval' in strict mode. -tests/cases/compiler/unaryOperatorsInStrictMode.ts(4,3): error TS2539: Cannot assign to 'eval' because it is not a variable. +tests/cases/compiler/unaryOperatorsInStrictMode.ts(4,3): error TS2630: Cannot assign to 'eval' because it is a function. tests/cases/compiler/unaryOperatorsInStrictMode.ts(5,3): error TS1100: Invalid use of 'arguments' in strict mode. tests/cases/compiler/unaryOperatorsInStrictMode.ts(5,3): error TS2304: Cannot find name 'arguments'. tests/cases/compiler/unaryOperatorsInStrictMode.ts(6,3): error TS1100: Invalid use of 'arguments' in strict mode. tests/cases/compiler/unaryOperatorsInStrictMode.ts(6,3): error TS2304: Cannot find name 'arguments'. tests/cases/compiler/unaryOperatorsInStrictMode.ts(7,1): error TS1100: Invalid use of 'eval' in strict mode. -tests/cases/compiler/unaryOperatorsInStrictMode.ts(7,1): error TS2539: Cannot assign to 'eval' because it is not a variable. +tests/cases/compiler/unaryOperatorsInStrictMode.ts(7,1): error TS2630: Cannot assign to 'eval' because it is a function. tests/cases/compiler/unaryOperatorsInStrictMode.ts(8,1): error TS1100: Invalid use of 'eval' in strict mode. -tests/cases/compiler/unaryOperatorsInStrictMode.ts(8,1): error TS2539: Cannot assign to 'eval' because it is not a variable. +tests/cases/compiler/unaryOperatorsInStrictMode.ts(8,1): error TS2630: Cannot assign to 'eval' because it is a function. tests/cases/compiler/unaryOperatorsInStrictMode.ts(9,1): error TS1100: Invalid use of 'arguments' in strict mode. tests/cases/compiler/unaryOperatorsInStrictMode.ts(9,1): error TS2304: Cannot find name 'arguments'. tests/cases/compiler/unaryOperatorsInStrictMode.ts(10,1): error TS1100: Invalid use of 'arguments' in strict mode. @@ -23,12 +23,12 @@ tests/cases/compiler/unaryOperatorsInStrictMode.ts(10,1): error TS2304: Cannot f ~~~~ !!! error TS1100: Invalid use of 'eval' in strict mode. ~~~~ -!!! error TS2539: Cannot assign to 'eval' because it is not a variable. +!!! error TS2630: Cannot assign to 'eval' because it is a function. --eval; ~~~~ !!! error TS1100: Invalid use of 'eval' in strict mode. ~~~~ -!!! error TS2539: Cannot assign to 'eval' because it is not a variable. +!!! error TS2630: Cannot assign to 'eval' because it is a function. ++arguments; ~~~~~~~~~ !!! error TS1100: Invalid use of 'arguments' in strict mode. @@ -43,12 +43,12 @@ tests/cases/compiler/unaryOperatorsInStrictMode.ts(10,1): error TS2304: Cannot f ~~~~ !!! error TS1100: Invalid use of 'eval' in strict mode. ~~~~ -!!! error TS2539: Cannot assign to 'eval' because it is not a variable. +!!! error TS2630: Cannot assign to 'eval' because it is a function. eval--; ~~~~ !!! error TS1100: Invalid use of 'eval' in strict mode. ~~~~ -!!! error TS2539: Cannot assign to 'eval' because it is not a variable. +!!! error TS2630: Cannot assign to 'eval' because it is a function. arguments++; ~~~~~~~~~ !!! error TS1100: Invalid use of 'arguments' in strict mode. diff --git a/tests/baselines/reference/user/debug.log b/tests/baselines/reference/user/debug.log index c6383f455c4..3dc8759c6f5 100644 --- a/tests/baselines/reference/user/debug.log +++ b/tests/baselines/reference/user/debug.log @@ -1,7 +1,7 @@ Exit Code: 2 Standard output: -node_modules/debug/src/browser.js(3,100): error TS2539: Cannot assign to '_typeof' because it is not a variable. -node_modules/debug/src/browser.js(3,165): error TS2539: Cannot assign to '_typeof' because it is not a variable. +node_modules/debug/src/browser.js(3,100): error TS2539: Cannot assign to '_typeof' because it is immutable. +node_modules/debug/src/browser.js(3,165): error TS2539: Cannot assign to '_typeof' because it is immutable. node_modules/debug/src/browser.js(34,74): error TS2339: Property 'type' does not exist on type 'Process'. node_modules/debug/src/browser.js(34,112): error TS2339: Property '__nwjs' does not exist on type 'Process'. node_modules/debug/src/browser.js(45,138): error TS2551: Property 'WebkitAppearance' does not exist on type 'CSSStyleDeclaration'. Did you mean 'webkitAppearance'? diff --git a/tests/baselines/reference/user/graceful-fs.log b/tests/baselines/reference/user/graceful-fs.log index 3aa362aa6bd..fe9205b433d 100644 --- a/tests/baselines/reference/user/graceful-fs.log +++ b/tests/baselines/reference/user/graceful-fs.log @@ -11,10 +11,10 @@ node_modules/graceful-fs/graceful-fs.js(74,30): error TS2345: Argument of type ' node_modules/graceful-fs/graceful-fs.js(86,13): error TS2554: Expected 0 arguments, but got 1. node_modules/graceful-fs/graceful-fs.js(97,54): error TS2339: Property '__patched' does not exist on type 'typeof import("fs")'. node_modules/graceful-fs/graceful-fs.js(99,8): error TS2339: Property '__patched' does not exist on type 'typeof import("fs")'. -node_modules/graceful-fs/graceful-fs.js(226,5): error TS2539: Cannot assign to 'ReadStream' because it is not a variable. -node_modules/graceful-fs/graceful-fs.js(227,5): error TS2539: Cannot assign to 'WriteStream' because it is not a variable. -node_modules/graceful-fs/graceful-fs.js(247,7): error TS2539: Cannot assign to 'ReadStream' because it is not a variable. -node_modules/graceful-fs/graceful-fs.js(257,7): error TS2539: Cannot assign to 'WriteStream' because it is not a variable. +node_modules/graceful-fs/graceful-fs.js(226,5): error TS2539: Cannot assign to 'ReadStream' because it is immutable. +node_modules/graceful-fs/graceful-fs.js(227,5): error TS2539: Cannot assign to 'WriteStream' because it is immutable. +node_modules/graceful-fs/graceful-fs.js(247,7): error TS2539: Cannot assign to 'ReadStream' because it is immutable. +node_modules/graceful-fs/graceful-fs.js(257,7): error TS2539: Cannot assign to 'WriteStream' because it is immutable. node_modules/graceful-fs/graceful-fs.js(291,68): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, any?, ...any[]]'. node_modules/graceful-fs/graceful-fs.js(314,70): error TS2345: Argument of type 'IArguments' is not assignable to parameter of type '[any?, any?, ...any[]]'. node_modules/graceful-fs/graceful-fs.js(363,9): error TS2554: Expected 0 arguments, but got 3. diff --git a/tests/baselines/reference/user/url-search-params.log b/tests/baselines/reference/user/url-search-params.log index cdfcbec5770..26ec77f0eb6 100644 --- a/tests/baselines/reference/user/url-search-params.log +++ b/tests/baselines/reference/user/url-search-params.log @@ -1,6 +1,6 @@ Exit Code: 2 Standard output: -node_modules/url-search-params/build/url-search-params.node.js(174,1): error TS2539: Cannot assign to 'URLSearchParams' because it is not a variable. +node_modules/url-search-params/build/url-search-params.node.js(174,1): error TS2539: Cannot assign to 'URLSearchParams' because it is immutable. diff --git a/tests/baselines/reference/validNullAssignments.errors.txt b/tests/baselines/reference/validNullAssignments.errors.txt index e3dd21599b5..b7699f77bc8 100644 --- a/tests/baselines/reference/validNullAssignments.errors.txt +++ b/tests/baselines/reference/validNullAssignments.errors.txt @@ -1,8 +1,8 @@ tests/cases/conformance/types/primitives/null/validNullAssignments.ts(10,3): error TS2540: Cannot assign to 'A' because it is a read-only property. -tests/cases/conformance/types/primitives/null/validNullAssignments.ts(15,1): error TS2539: Cannot assign to 'C' because it is not a variable. +tests/cases/conformance/types/primitives/null/validNullAssignments.ts(15,1): error TS2629: Cannot assign to 'C' because it is a class. tests/cases/conformance/types/primitives/null/validNullAssignments.ts(20,1): error TS2693: 'I' only refers to a type, but is being used as a value here. -tests/cases/conformance/types/primitives/null/validNullAssignments.ts(23,1): error TS2539: Cannot assign to 'M' because it is not a variable. -tests/cases/conformance/types/primitives/null/validNullAssignments.ts(30,1): error TS2539: Cannot assign to 'i' because it is not a variable. +tests/cases/conformance/types/primitives/null/validNullAssignments.ts(23,1): error TS2631: Cannot assign to 'M' because it is a namespace. +tests/cases/conformance/types/primitives/null/validNullAssignments.ts(30,1): error TS2630: Cannot assign to 'i' because it is a function. ==== tests/cases/conformance/types/primitives/null/validNullAssignments.ts (5 errors) ==== @@ -24,7 +24,7 @@ tests/cases/conformance/types/primitives/null/validNullAssignments.ts(30,1): err f = null; // ok C = null; // error ~ -!!! error TS2539: Cannot assign to 'C' because it is not a variable. +!!! error TS2629: Cannot assign to 'C' because it is a class. interface I { foo: string } var g: I; @@ -36,7 +36,7 @@ tests/cases/conformance/types/primitives/null/validNullAssignments.ts(30,1): err module M { export var x = 1; } M = null; // error ~ -!!! error TS2539: Cannot assign to 'M' because it is not a variable. +!!! error TS2631: Cannot assign to 'M' because it is a namespace. var h: { f(): void } = null; @@ -45,4 +45,4 @@ tests/cases/conformance/types/primitives/null/validNullAssignments.ts(30,1): err } i = null; // error ~ -!!! error TS2539: Cannot assign to 'i' because it is not a variable. \ No newline at end of file +!!! error TS2630: Cannot assign to 'i' because it is a function. \ No newline at end of file