From 28fc0a28b0b77066746dbedb1441f27449a2cb60 Mon Sep 17 00:00:00 2001 From: Alexander T Date: Fri, 2 Nov 2018 17:43:13 +0200 Subject: [PATCH 1/5] add new error message 'Cannot assign to {0} because it is a constant.' --- src/compiler/checker.ts | 7 +- src/compiler/diagnosticMessages.json | 4 ++ .../constDeclarations-access.errors.txt | 4 +- .../constDeclarations-access2.errors.txt | 68 +++++++++---------- .../constDeclarations-errors.errors.txt | 4 +- .../reference/constWithNonNull.errors.txt | 4 +- tests/baselines/reference/for-of2.errors.txt | 4 +- .../reference/redefineArray.errors.txt | 4 +- 8 files changed, 54 insertions(+), 45 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 7df0414b90b..3c99001be1b 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -15891,7 +15891,12 @@ namespace ts { return errorType; } if (isReadonlySymbol(localOrExportSymbol)) { - error(node, Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(symbol)); + if (localOrExportSymbol.flags & SymbolFlags.Variable) { + error(node, Diagnostics.Cannot_assign_to_0_because_it_is_a_constant, symbolToString(symbol)); + } + else { + error(node, Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(symbol)); + } return errorType; } } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index e2dd0a1b7cd..4b6d97b5332 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2124,6 +2124,10 @@ "category": "Error", "code": 2587 }, + "Cannot assign to '{0}' because it is a constant.": { + "category": "Error", + "code": 2588 + }, "JSX element attributes type '{0}' may not be a union type.": { "category": "Error", "code": 2600 diff --git a/tests/baselines/reference/constDeclarations-access.errors.txt b/tests/baselines/reference/constDeclarations-access.errors.txt index c9c730456e2..4accefa01bc 100644 --- a/tests/baselines/reference/constDeclarations-access.errors.txt +++ b/tests/baselines/reference/constDeclarations-access.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/file2.ts(1,1): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/file2.ts(1,1): error TS2588: Cannot assign to 'x' because it is a constant. ==== tests/cases/compiler/file1.ts (0 errors) ==== @@ -7,4 +7,4 @@ tests/cases/compiler/file2.ts(1,1): error TS2540: Cannot assign to 'x' because i ==== tests/cases/compiler/file2.ts (1 errors) ==== x++; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. \ No newline at end of file +!!! error TS2588: Cannot assign to 'x' because it is a constant. \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-access2.errors.txt b/tests/baselines/reference/constDeclarations-access2.errors.txt index dc8b4d5b90b..dfb796e25fd 100644 --- a/tests/baselines/reference/constDeclarations-access2.errors.txt +++ b/tests/baselines/reference/constDeclarations-access2.errors.txt @@ -1,20 +1,20 @@ -tests/cases/compiler/constDeclarations-access2.ts(4,1): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access2.ts(5,1): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access2.ts(6,1): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access2.ts(7,1): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access2.ts(8,1): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access2.ts(9,1): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access2.ts(10,1): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access2.ts(11,1): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access2.ts(12,1): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access2.ts(13,1): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access2.ts(14,1): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access2.ts(15,1): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access2.ts(17,1): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access2.ts(18,1): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access2.ts(19,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access2.ts(20,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access2.ts(22,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access2.ts(4,1): error TS2588: Cannot assign to 'x' because it is a constant. +tests/cases/compiler/constDeclarations-access2.ts(5,1): error TS2588: Cannot assign to 'x' because it is a constant. +tests/cases/compiler/constDeclarations-access2.ts(6,1): error TS2588: Cannot assign to 'x' because it is a constant. +tests/cases/compiler/constDeclarations-access2.ts(7,1): error TS2588: Cannot assign to 'x' because it is a constant. +tests/cases/compiler/constDeclarations-access2.ts(8,1): error TS2588: Cannot assign to 'x' because it is a constant. +tests/cases/compiler/constDeclarations-access2.ts(9,1): error TS2588: Cannot assign to 'x' because it is a constant. +tests/cases/compiler/constDeclarations-access2.ts(10,1): error TS2588: Cannot assign to 'x' because it is a constant. +tests/cases/compiler/constDeclarations-access2.ts(11,1): error TS2588: Cannot assign to 'x' because it is a constant. +tests/cases/compiler/constDeclarations-access2.ts(12,1): error TS2588: Cannot assign to 'x' because it is a constant. +tests/cases/compiler/constDeclarations-access2.ts(13,1): error TS2588: Cannot assign to 'x' because it is a constant. +tests/cases/compiler/constDeclarations-access2.ts(14,1): error TS2588: Cannot assign to 'x' because it is a constant. +tests/cases/compiler/constDeclarations-access2.ts(15,1): error TS2588: Cannot assign to 'x' because it is a constant. +tests/cases/compiler/constDeclarations-access2.ts(17,1): error TS2588: Cannot assign to 'x' because it is a constant. +tests/cases/compiler/constDeclarations-access2.ts(18,1): error TS2588: Cannot assign to 'x' because it is a constant. +tests/cases/compiler/constDeclarations-access2.ts(19,3): error TS2588: Cannot assign to 'x' because it is a constant. +tests/cases/compiler/constDeclarations-access2.ts(20,3): error TS2588: Cannot assign to 'x' because it is a constant. +tests/cases/compiler/constDeclarations-access2.ts(22,5): error TS2588: Cannot assign to 'x' because it is a constant. ==== tests/cases/compiler/constDeclarations-access2.ts (17 errors) ==== @@ -23,57 +23,57 @@ tests/cases/compiler/constDeclarations-access2.ts(22,5): error TS2540: Cannot as // Errors x = 1; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'x' because it is a constant. x += 2; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'x' because it is a constant. x -= 3; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'x' because it is a constant. x *= 4; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'x' because it is a constant. x /= 5; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'x' because it is a constant. x %= 6; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'x' because it is a constant. x <<= 7; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'x' because it is a constant. x >>= 8; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'x' because it is a constant. x >>>= 9; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'x' because it is a constant. x &= 10; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'x' because it is a constant. x |= 11; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'x' because it is a constant. x ^= 12; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'x' because it is a constant. x++; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'x' because it is a constant. x--; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'x' because it is a constant. ++x; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'x' because it is a constant. --x; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'x' because it is a constant. ++((x)); ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'x' because it is a constant. // OK var a = x + 1; diff --git a/tests/baselines/reference/constDeclarations-errors.errors.txt b/tests/baselines/reference/constDeclarations-errors.errors.txt index 52579561707..d945ce10aa5 100644 --- a/tests/baselines/reference/constDeclarations-errors.errors.txt +++ b/tests/baselines/reference/constDeclarations-errors.errors.txt @@ -4,7 +4,7 @@ tests/cases/compiler/constDeclarations-errors.ts(4,7): error TS1155: 'const' dec tests/cases/compiler/constDeclarations-errors.ts(4,11): error TS1155: 'const' declarations must be initialized. tests/cases/compiler/constDeclarations-errors.ts(4,15): error TS1155: 'const' declarations must be initialized. tests/cases/compiler/constDeclarations-errors.ts(4,27): error TS1155: 'const' declarations must be initialized. -tests/cases/compiler/constDeclarations-errors.ts(9,27): error TS2540: Cannot assign to 'c8' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-errors.ts(9,27): error TS2588: Cannot assign to 'c8' because it is a constant. tests/cases/compiler/constDeclarations-errors.ts(12,11): error TS1155: 'const' declarations must be initialized. tests/cases/compiler/constDeclarations-errors.ts(15,20): error TS1155: 'const' declarations must be initialized. @@ -32,7 +32,7 @@ tests/cases/compiler/constDeclarations-errors.ts(15,20): error TS1155: 'const' d // error, assigning to a const for(const c8 = 0; c8 < 1; c8++) { } ~~ -!!! error TS2540: Cannot assign to 'c8' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'c8' because it is a constant. // error, can not be unintalized for(const c9; c9 < 1;) { } diff --git a/tests/baselines/reference/constWithNonNull.errors.txt b/tests/baselines/reference/constWithNonNull.errors.txt index 58667c417da..840b26c5f35 100644 --- a/tests/baselines/reference/constWithNonNull.errors.txt +++ b/tests/baselines/reference/constWithNonNull.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/constWithNonNull.ts(4,1): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constWithNonNull.ts(4,1): error TS2588: Cannot assign to 'x' because it is a constant. ==== tests/cases/compiler/constWithNonNull.ts (1 errors) ==== @@ -7,5 +7,5 @@ tests/cases/compiler/constWithNonNull.ts(4,1): error TS2540: Cannot assign to 'x declare const x: number | undefined; x!++; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2588: Cannot assign to 'x' because it is a constant. \ No newline at end of file diff --git a/tests/baselines/reference/for-of2.errors.txt b/tests/baselines/reference/for-of2.errors.txt index 3bf3b679898..f1ff169a58e 100644 --- a/tests/baselines/reference/for-of2.errors.txt +++ b/tests/baselines/reference/for-of2.errors.txt @@ -1,5 +1,5 @@ tests/cases/conformance/es6/for-ofStatements/for-of2.ts(1,7): error TS1155: 'const' declarations must be initialized. -tests/cases/conformance/es6/for-ofStatements/for-of2.ts(2,6): error TS2540: Cannot assign to 'v' because it is a constant or a read-only property. +tests/cases/conformance/es6/for-ofStatements/for-of2.ts(2,6): error TS2588: Cannot assign to 'v' because it is a constant. ==== tests/cases/conformance/es6/for-ofStatements/for-of2.ts (2 errors) ==== @@ -8,4 +8,4 @@ tests/cases/conformance/es6/for-ofStatements/for-of2.ts(2,6): error TS2540: Cann !!! error TS1155: 'const' declarations must be initialized. for (v of []) { } ~ -!!! error TS2540: Cannot assign to 'v' because it is a constant or a read-only property. \ No newline at end of file +!!! error TS2588: Cannot assign to 'v' because it is a constant. \ No newline at end of file diff --git a/tests/baselines/reference/redefineArray.errors.txt b/tests/baselines/reference/redefineArray.errors.txt index 6a9cf954798..dd3727b0216 100644 --- a/tests/baselines/reference/redefineArray.errors.txt +++ b/tests/baselines/reference/redefineArray.errors.txt @@ -1,7 +1,7 @@ -tests/cases/compiler/redefineArray.ts(1,1): error TS2540: Cannot assign to 'Array' because it is a constant or a read-only property. +tests/cases/compiler/redefineArray.ts(1,1): error TS2588: Cannot assign to 'Array' because it is a constant. ==== tests/cases/compiler/redefineArray.ts (1 errors) ==== Array = function (n:number, s:string) {return n;}; ~~~~~ -!!! error TS2540: Cannot assign to 'Array' because it is a constant or a read-only property. \ No newline at end of file +!!! error TS2588: Cannot assign to 'Array' because it is a constant. \ No newline at end of file From ae8d54658a9a16231bef13bb25d0634d7c99151e Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 3 Nov 2018 16:07:20 +0200 Subject: [PATCH 2/5] exclude mention about constant from error message 'a-constant-or-a-read-only-property' to be more specific. --- src/compiler/checker.ts | 6 +++--- src/compiler/diagnosticMessages.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3c99001be1b..960461ca2fc 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -9339,7 +9339,7 @@ namespace ts { if (accessExpression) { markPropertyAsReferenced(prop, accessExpression, /*isThisAccess*/ accessExpression.expression.kind === SyntaxKind.ThisKeyword); if (isAssignmentTarget(accessExpression) && (isReferenceToReadonlyEntity(accessExpression, prop) || isReferenceThroughNamespaceImport(accessExpression))) { - error(accessExpression.argumentExpression, Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(prop)); + error(accessExpression.argumentExpression, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(prop)); return missingType; } if (cacheSymbol) { @@ -15895,7 +15895,7 @@ namespace ts { error(node, Diagnostics.Cannot_assign_to_0_because_it_is_a_constant, symbolToString(symbol)); } else { - error(node, Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, symbolToString(symbol)); + error(node, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, symbolToString(symbol)); } return errorType; } @@ -18468,7 +18468,7 @@ namespace ts { checkPropertyAccessibility(node, left.kind === SyntaxKind.SuperKeyword, apparentType, prop); if (assignmentKind) { if (isReferenceToReadonlyEntity(node, prop) || isReferenceThroughNamespaceImport(node)) { - error(right, Diagnostics.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property, idText(right)); + error(right, Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, idText(right)); return errorType; } } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 4b6d97b5332..c799bb08ff1 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -1944,7 +1944,7 @@ "category": "Error", "code": 2539 }, - "Cannot assign to '{0}' because it is a constant or a read-only property.": { + "Cannot assign to '{0}' because it is a read-only property.": { "category": "Error", "code": 2540 }, From 66539b4378990fabdc4caf37a6511db8a11d0a01 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 3 Nov 2018 16:10:56 +0200 Subject: [PATCH 3/5] accept baseline for changed error message #2540 --- .../abstractPropertyNegative.errors.txt | 4 +- .../reference/assignToEnum.errors.txt | 8 +-- .../reference/assignments.errors.txt | 4 +- ...heckExportsObjectAssignProperty.errors.txt | 16 ++--- ...tsObjectAssignPrototypeProperty.errors.txt | 8 +-- .../checkObjectDefineProperty.errors.txt | 12 ++-- .../checkOtherObjectAssignProperty.errors.txt | 12 ++-- .../reference/conditionalTypes1.errors.txt | 8 +-- .../constDeclarations-access3.errors.txt | 72 +++++++++---------- .../constDeclarations-access4.errors.txt | 72 +++++++++---------- .../constDeclarations-access5.errors.txt | 72 +++++++++---------- .../constEnumPropertyAccess2.errors.txt | 4 +- .../decrementOperatorWithEnumType.errors.txt | 12 ++-- .../reference/enumMergeWithExpando.errors.txt | 8 +-- ...externalModuleImmutableBindings.errors.txt | 64 ++++++++--------- .../importsImplicitlyReadonly.errors.txt | 8 +-- .../incrementOperatorWithEnumType.errors.txt | 16 ++--- .../intersectionTypeReadonly.errors.txt | 20 +++--- .../invalidUndefinedAssignments.errors.txt | 4 +- .../reference/mappedTypes6.errors.txt | 12 ++-- .../reference/objectFreeze.errors.txt | 4 +- .../nodeModulesMaxDepthExceeded.errors.txt | 4 +- .../nodeModulesMaxDepthExceeded.errors.txt | 4 +- ...mentInSubclassOfClassExpression.errors.txt | 4 +- .../readonlyConstructorAssignment.errors.txt | 4 +- ...readonlyInConstructorParameters.errors.txt | 4 +- .../reference/readonlyMembers.errors.txt | 52 +++++++------- .../reference/unionTypeReadonly.errors.txt | 16 ++--- .../unionTypeWithIndexSignature.errors.txt | 4 +- .../reference/validNullAssignments.errors.txt | 4 +- 30 files changed, 268 insertions(+), 268 deletions(-) diff --git a/tests/baselines/reference/abstractPropertyNegative.errors.txt b/tests/baselines/reference/abstractPropertyNegative.errors.txt index be1c85374fb..fd09b024213 100644 --- a/tests/baselines/reference/abstractPropertyNegative.errors.txt +++ b/tests/baselines/reference/abstractPropertyNegative.errors.txt @@ -6,7 +6,7 @@ tests/cases/compiler/abstractPropertyNegative.ts(13,7): error TS2515: Non-abstra tests/cases/compiler/abstractPropertyNegative.ts(13,7): error TS2515: Non-abstract class 'C' does not implement inherited abstract member 'readonlyProp' from class 'B'. tests/cases/compiler/abstractPropertyNegative.ts(15,5): error TS1244: Abstract methods can only appear within an abstract class. tests/cases/compiler/abstractPropertyNegative.ts(16,37): error TS1005: '{' expected. -tests/cases/compiler/abstractPropertyNegative.ts(19,3): error TS2540: Cannot assign to 'ro' because it is a constant or a read-only property. +tests/cases/compiler/abstractPropertyNegative.ts(19,3): error TS2540: Cannot assign to 'ro' because it is a read-only property. tests/cases/compiler/abstractPropertyNegative.ts(25,5): error TS2416: Property 'num' in type 'WrongTypePropertyImpl' is not assignable to the same property in base type 'WrongTypeProperty'. Type 'string' is not assignable to type 'number'. tests/cases/compiler/abstractPropertyNegative.ts(31,9): error TS2416: Property 'num' in type 'WrongTypeAccessorImpl' is not assignable to the same property in base type 'WrongTypeAccessor'. @@ -56,7 +56,7 @@ tests/cases/compiler/abstractPropertyNegative.ts(41,18): error TS2676: Accessors let c = new C(); c.ro = "error: lhs of assignment can't be readonly"; ~~ -!!! error TS2540: Cannot assign to 'ro' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'ro' because it is a read-only property. abstract class WrongTypeProperty { abstract num: number; diff --git a/tests/baselines/reference/assignToEnum.errors.txt b/tests/baselines/reference/assignToEnum.errors.txt index 438a002ef1e..53b4afc1864 100644 --- a/tests/baselines/reference/assignToEnum.errors.txt +++ b/tests/baselines/reference/assignToEnum.errors.txt @@ -1,7 +1,7 @@ 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(4,3): error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property. -tests/cases/compiler/assignToEnum.ts(5,3): error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property. +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. ==== tests/cases/compiler/assignToEnum.ts (4 errors) ==== @@ -14,9 +14,9 @@ tests/cases/compiler/assignToEnum.ts(5,3): error TS2540: Cannot assign to 'foo' !!! error TS2539: Cannot assign to 'A' because it is not a variable. A.foo = 1; // invalid LHS ~~~ -!!! error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'foo' because it is a read-only property. A.foo = A.bar; // invalid LHS ~~~ -!!! error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'foo' because it is a read-only property. \ No newline at end of file diff --git a/tests/baselines/reference/assignments.errors.txt b/tests/baselines/reference/assignments.errors.txt index cb8b7a17bdf..19cdbd813a6 100644 --- a/tests/baselines/reference/assignments.errors.txt +++ b/tests/baselines/reference/assignments.errors.txt @@ -1,7 +1,7 @@ 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(18,3): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +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(31,1): error TS2693: 'I' only refers to a type, but is being used as a value here. @@ -32,7 +32,7 @@ tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(31,1): er !!! error TS2539: Cannot assign to 'E' because it is not a variable. E.A = null; // OK per spec, Error per implementation (509581) ~ -!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'A' because it is a read-only property. function fn() { } fn = null; // Should be error diff --git a/tests/baselines/reference/checkExportsObjectAssignProperty.errors.txt b/tests/baselines/reference/checkExportsObjectAssignProperty.errors.txt index 266c2180a68..cce3d89a761 100644 --- a/tests/baselines/reference/checkExportsObjectAssignProperty.errors.txt +++ b/tests/baselines/reference/checkExportsObjectAssignProperty.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/jsdoc/validator.ts(17,4): error TS2540: Cannot assign to 'readonlyProp' because it is a constant or a read-only property. -tests/cases/conformance/jsdoc/validator.ts(18,4): error TS2540: Cannot assign to 'readonlyAccessor' because it is a constant or a read-only property. +tests/cases/conformance/jsdoc/validator.ts(17,4): error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. +tests/cases/conformance/jsdoc/validator.ts(18,4): error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. tests/cases/conformance/jsdoc/validator.ts(19,1): error TS2322: Type '"no"' is not assignable to type 'number'. tests/cases/conformance/jsdoc/validator.ts(20,1): error TS2322: Type '"no"' is not assignable to type 'number'. tests/cases/conformance/jsdoc/validator.ts(21,1): error TS2322: Type '0' is not assignable to type 'string'. -tests/cases/conformance/jsdoc/validator.ts(37,4): error TS2540: Cannot assign to 'readonlyProp' because it is a constant or a read-only property. -tests/cases/conformance/jsdoc/validator.ts(38,4): error TS2540: Cannot assign to 'readonlyAccessor' because it is a constant or a read-only property. +tests/cases/conformance/jsdoc/validator.ts(37,4): error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. +tests/cases/conformance/jsdoc/validator.ts(38,4): error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. tests/cases/conformance/jsdoc/validator.ts(39,1): error TS2322: Type '0' is not assignable to type 'string'. tests/cases/conformance/jsdoc/validator.ts(40,1): error TS2322: Type '"no"' is not assignable to type 'number'. tests/cases/conformance/jsdoc/validator.ts(41,1): error TS2322: Type '0' is not assignable to type 'string'. @@ -29,10 +29,10 @@ tests/cases/conformance/jsdoc/validator.ts(41,1): error TS2322: Type '0' is not // disallowed assignments m1.readonlyProp = "name"; ~~~~~~~~~~~~ -!!! error TS2540: Cannot assign to 'readonlyProp' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. m1.readonlyAccessor = 12; ~~~~~~~~~~~~~~~~ -!!! error TS2540: Cannot assign to 'readonlyAccessor' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. m1.thing = "no"; ~~~~~~~~ !!! error TS2322: Type '"no"' is not assignable to type 'number'. @@ -59,10 +59,10 @@ tests/cases/conformance/jsdoc/validator.ts(41,1): error TS2322: Type '0' is not // disallowed assignments m2.readonlyProp = "name"; ~~~~~~~~~~~~ -!!! error TS2540: Cannot assign to 'readonlyProp' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. m2.readonlyAccessor = 12; ~~~~~~~~~~~~~~~~ -!!! error TS2540: Cannot assign to 'readonlyAccessor' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. m2.thing = 0; ~~~~~~~~ !!! error TS2322: Type '0' is not assignable to type 'string'. diff --git a/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.errors.txt b/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.errors.txt index c2621a71b99..4d9ced85253 100644 --- a/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.errors.txt +++ b/tests/baselines/reference/checkExportsObjectAssignPrototypeProperty.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/jsdoc/validator.ts(19,4): error TS2540: Cannot assign to 'readonlyProp' because it is a constant or a read-only property. -tests/cases/conformance/jsdoc/validator.ts(20,4): error TS2540: Cannot assign to 'readonlyAccessor' because it is a constant or a read-only property. +tests/cases/conformance/jsdoc/validator.ts(19,4): error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. +tests/cases/conformance/jsdoc/validator.ts(20,4): error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. tests/cases/conformance/jsdoc/validator.ts(21,1): error TS2322: Type '"no"' is not assignable to type 'number'. tests/cases/conformance/jsdoc/validator.ts(22,1): error TS2322: Type '"no"' is not assignable to type 'number'. tests/cases/conformance/jsdoc/validator.ts(23,1): error TS2322: Type '0' is not assignable to type 'string'. @@ -26,10 +26,10 @@ tests/cases/conformance/jsdoc/validator.ts(23,1): error TS2322: Type '0' is not // disallowed assignments m1.readonlyProp = "name"; ~~~~~~~~~~~~ -!!! error TS2540: Cannot assign to 'readonlyProp' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. m1.readonlyAccessor = 12; ~~~~~~~~~~~~~~~~ -!!! error TS2540: Cannot assign to 'readonlyAccessor' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. m1.thing = "no"; ~~~~~~~~ !!! error TS2322: Type '"no"' is not assignable to type 'number'. diff --git a/tests/baselines/reference/checkObjectDefineProperty.errors.txt b/tests/baselines/reference/checkObjectDefineProperty.errors.txt index b587955ef2f..373b219d96c 100644 --- a/tests/baselines/reference/checkObjectDefineProperty.errors.txt +++ b/tests/baselines/reference/checkObjectDefineProperty.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/jsdoc/validate.ts(14,3): error TS2540: Cannot assign to 'lastName' because it is a constant or a read-only property. -tests/cases/conformance/jsdoc/validate.ts(15,3): error TS2540: Cannot assign to 'houseNumber' because it is a constant or a read-only property. +tests/cases/conformance/jsdoc/validate.ts(14,3): error TS2540: Cannot assign to 'lastName' because it is a read-only property. +tests/cases/conformance/jsdoc/validate.ts(15,3): error TS2540: Cannot assign to 'houseNumber' because it is a read-only property. tests/cases/conformance/jsdoc/validate.ts(16,1): error TS2322: Type '12' is not assignable to type 'string'. -tests/cases/conformance/jsdoc/validate.ts(17,3): error TS2540: Cannot assign to 'middleInit' because it is a constant or a read-only property. +tests/cases/conformance/jsdoc/validate.ts(17,3): error TS2540: Cannot assign to 'middleInit' because it is a read-only property. ==== tests/cases/conformance/jsdoc/validate.ts (4 errors) ==== @@ -20,16 +20,16 @@ tests/cases/conformance/jsdoc/validate.ts(17,3): error TS2540: Cannot assign to x.lastName = "should fail"; ~~~~~~~~ -!!! error TS2540: Cannot assign to 'lastName' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'lastName' because it is a read-only property. x.houseNumber = 12; // should also fail ~~~~~~~~~~~ -!!! error TS2540: Cannot assign to 'houseNumber' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'houseNumber' because it is a read-only property. x.zipStr = 12; // should fail ~~~~~~~~ !!! error TS2322: Type '12' is not assignable to type 'string'. x.middleInit = "R"; // should also fail ~~~~~~~~~~ -!!! error TS2540: Cannot assign to 'middleInit' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'middleInit' because it is a read-only property. ==== tests/cases/conformance/jsdoc/index.js (0 errors) ==== const x = {}; diff --git a/tests/baselines/reference/checkOtherObjectAssignProperty.errors.txt b/tests/baselines/reference/checkOtherObjectAssignProperty.errors.txt index 146550d6fb6..eb7f066c0b1 100644 --- a/tests/baselines/reference/checkOtherObjectAssignProperty.errors.txt +++ b/tests/baselines/reference/checkOtherObjectAssignProperty.errors.txt @@ -2,9 +2,9 @@ tests/cases/conformance/jsdoc/importer.js(3,5): error TS2339: Property 'other' d tests/cases/conformance/jsdoc/importer.js(4,5): error TS2339: Property 'prop' does not exist on type 'typeof import("tests/cases/conformance/jsdoc/mod1")'. tests/cases/conformance/jsdoc/importer.js(11,5): error TS2339: Property 'other' does not exist on type 'typeof import("tests/cases/conformance/jsdoc/mod1")'. tests/cases/conformance/jsdoc/importer.js(12,5): error TS2339: Property 'prop' does not exist on type 'typeof import("tests/cases/conformance/jsdoc/mod1")'. -tests/cases/conformance/jsdoc/importer.js(13,5): error TS2540: Cannot assign to 'bad1' because it is a constant or a read-only property. -tests/cases/conformance/jsdoc/importer.js(14,5): error TS2540: Cannot assign to 'bad2' because it is a constant or a read-only property. -tests/cases/conformance/jsdoc/importer.js(15,5): error TS2540: Cannot assign to 'bad3' because it is a constant or a read-only property. +tests/cases/conformance/jsdoc/importer.js(13,5): error TS2540: Cannot assign to 'bad1' because it is a read-only property. +tests/cases/conformance/jsdoc/importer.js(14,5): error TS2540: Cannot assign to 'bad2' because it is a read-only property. +tests/cases/conformance/jsdoc/importer.js(15,5): error TS2540: Cannot assign to 'bad3' because it is a read-only property. ==== tests/cases/conformance/jsdoc/importer.js (7 errors) ==== @@ -30,13 +30,13 @@ tests/cases/conformance/jsdoc/importer.js(15,5): error TS2540: Cannot assign to !!! error TS2339: Property 'prop' does not exist on type 'typeof import("tests/cases/conformance/jsdoc/mod1")'. mod.bad1 = 0; ~~~~ -!!! error TS2540: Cannot assign to 'bad1' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'bad1' because it is a read-only property. mod.bad2 = 0; ~~~~ -!!! error TS2540: Cannot assign to 'bad2' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'bad2' because it is a read-only property. mod.bad3 = 0; ~~~~ -!!! error TS2540: Cannot assign to 'bad3' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'bad3' because it is a read-only property. ==== tests/cases/conformance/jsdoc/mod1.js (0 errors) ==== const obj = { value: 42, writable: true }; diff --git a/tests/baselines/reference/conditionalTypes1.errors.txt b/tests/baselines/reference/conditionalTypes1.errors.txt index 4018e0866d6..8bf05c043ce 100644 --- a/tests/baselines/reference/conditionalTypes1.errors.txt +++ b/tests/baselines/reference/conditionalTypes1.errors.txt @@ -31,9 +31,9 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(116,5): error TS2 Type 'string' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. tests/cases/conformance/types/conditional/conditionalTypes1.ts(117,5): error TS2322: Type 'T[keyof T] extends Function ? keyof T : never' is not assignable to type 'T[keyof T] extends Function ? never : keyof T'. Type 'keyof T' is not assignable to type 'never'. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(134,10): error TS2540: Cannot assign to 'id' because it is a constant or a read-only property. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(134,10): error TS2540: Cannot assign to 'id' because it is a read-only property. tests/cases/conformance/types/conditional/conditionalTypes1.ts(135,5): error TS2542: Index signature in type 'DeepReadonlyArray' only permits reading. -tests/cases/conformance/types/conditional/conditionalTypes1.ts(136,22): error TS2540: Cannot assign to 'id' because it is a constant or a read-only property. +tests/cases/conformance/types/conditional/conditionalTypes1.ts(136,22): error TS2540: Cannot assign to 'id' because it is a read-only property. tests/cases/conformance/types/conditional/conditionalTypes1.ts(137,10): error TS2339: Property 'updatePart' does not exist on type 'DeepReadonlyObject'. tests/cases/conformance/types/conditional/conditionalTypes1.ts(159,5): error TS2322: Type 'ZeroOf' is not assignable to type 'T'. Type '0 | (T extends string ? "" : false)' is not assignable to type 'T'. @@ -231,13 +231,13 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(288,43): error TS let id: number = part.subparts[0].id; part.id = part.id; // Error ~~ -!!! error TS2540: Cannot assign to 'id' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'id' because it is a read-only property. part.subparts[0] = part.subparts[0]; // Error ~~~~~~~~~~~~~~~~ !!! error TS2542: Index signature in type 'DeepReadonlyArray' only permits reading. part.subparts[0].id = part.subparts[0].id; // Error ~~ -!!! error TS2540: Cannot assign to 'id' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'id' because it is a read-only property. part.updatePart("hello"); // Error ~~~~~~~~~~ !!! error TS2339: Property 'updatePart' does not exist on type 'DeepReadonlyObject'. diff --git a/tests/baselines/reference/constDeclarations-access3.errors.txt b/tests/baselines/reference/constDeclarations-access3.errors.txt index dd55ef9166d..b6cada1c939 100644 --- a/tests/baselines/reference/constDeclarations-access3.errors.txt +++ b/tests/baselines/reference/constDeclarations-access3.errors.txt @@ -1,21 +1,21 @@ -tests/cases/compiler/constDeclarations-access3.ts(6,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(7,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(8,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(9,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(10,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(11,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(12,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(13,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(14,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(15,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(16,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(17,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(19,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(20,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(21,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(22,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(24,7): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access3.ts(26,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(6,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(7,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(8,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(9,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(10,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(11,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(12,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(13,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(14,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(15,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(16,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(17,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(19,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(20,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(21,5): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(22,5): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(24,7): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access3.ts(26,3): error TS2540: Cannot assign to 'x' because it is a read-only property. ==== tests/cases/compiler/constDeclarations-access3.ts (18 errors) ==== @@ -26,61 +26,61 @@ tests/cases/compiler/constDeclarations-access3.ts(26,3): error TS2540: Cannot as // Errors M.x = 1; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x += 2; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x -= 3; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x *= 4; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x /= 5; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x %= 6; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x <<= 7; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x >>= 8; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x >>>= 9; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x &= 10; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x |= 11; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x ^= 12; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x++; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x--; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. ++M.x; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. --M.x; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. ++((M.x)); ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M["x"] = 0; ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. // OK var a = M.x + 1; diff --git a/tests/baselines/reference/constDeclarations-access4.errors.txt b/tests/baselines/reference/constDeclarations-access4.errors.txt index 5bc4f1fadda..24ad11b2a3d 100644 --- a/tests/baselines/reference/constDeclarations-access4.errors.txt +++ b/tests/baselines/reference/constDeclarations-access4.errors.txt @@ -1,21 +1,21 @@ -tests/cases/compiler/constDeclarations-access4.ts(6,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(7,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(8,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(9,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(10,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(11,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(12,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(13,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(14,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(15,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(16,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(17,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(19,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(20,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(21,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(22,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(24,7): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations-access4.ts(26,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(6,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(7,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(8,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(9,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(10,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(11,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(12,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(13,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(14,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(15,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(16,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(17,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(19,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(20,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(21,5): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(22,5): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(24,7): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations-access4.ts(26,3): error TS2540: Cannot assign to 'x' because it is a read-only property. ==== tests/cases/compiler/constDeclarations-access4.ts (18 errors) ==== @@ -26,61 +26,61 @@ tests/cases/compiler/constDeclarations-access4.ts(26,3): error TS2540: Cannot as // Errors M.x = 1; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x += 2; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x -= 3; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x *= 4; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x /= 5; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x %= 6; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x <<= 7; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x >>= 8; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x >>>= 9; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x &= 10; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x |= 11; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x ^= 12; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x++; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M.x--; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. ++M.x; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. --M.x; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. ++((M.x)); ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. M["x"] = 0; ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. // OK var a = M.x + 1; diff --git a/tests/baselines/reference/constDeclarations-access5.errors.txt b/tests/baselines/reference/constDeclarations-access5.errors.txt index 61d579dccc5..739a8fca1fc 100644 --- a/tests/baselines/reference/constDeclarations-access5.errors.txt +++ b/tests/baselines/reference/constDeclarations-access5.errors.txt @@ -1,21 +1,21 @@ -tests/cases/compiler/constDeclarations_access_2.ts(4,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations_access_2.ts(5,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations_access_2.ts(6,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations_access_2.ts(7,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations_access_2.ts(8,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations_access_2.ts(9,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations_access_2.ts(10,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations_access_2.ts(11,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations_access_2.ts(12,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations_access_2.ts(13,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations_access_2.ts(14,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations_access_2.ts(15,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations_access_2.ts(17,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations_access_2.ts(18,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations_access_2.ts(19,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations_access_2.ts(20,5): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations_access_2.ts(22,7): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/constDeclarations_access_2.ts(24,3): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(4,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(5,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(6,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(7,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(8,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(9,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(10,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(11,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(12,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(13,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(14,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(15,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(17,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(18,3): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(19,5): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(20,5): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(22,7): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/constDeclarations_access_2.ts(24,3): error TS2540: Cannot assign to 'x' because it is a read-only property. ==== tests/cases/compiler/constDeclarations_access_2.ts (18 errors) ==== @@ -24,61 +24,61 @@ tests/cases/compiler/constDeclarations_access_2.ts(24,3): error TS2540: Cannot a // Errors m.x = 1; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x += 2; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x -= 3; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x *= 4; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x /= 5; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x %= 6; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x <<= 7; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x >>= 8; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x >>>= 9; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x &= 10; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x |= 11; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x ^= 12; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m m.x++; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m.x--; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. ++m.x; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. --m.x; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. ++((m.x)); ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. m["x"] = 0; ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. // OK var a = m.x + 1; diff --git a/tests/baselines/reference/constEnumPropertyAccess2.errors.txt b/tests/baselines/reference/constEnumPropertyAccess2.errors.txt index 40731d3ad54..c80283f6536 100644 --- a/tests/baselines/reference/constEnumPropertyAccess2.errors.txt +++ b/tests/baselines/reference/constEnumPropertyAccess2.errors.txt @@ -1,7 +1,7 @@ tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(13,9): error TS2475: 'const' enums can only be used in property or index access expressions or the right hand side of an import declaration or export assignment or type query. tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(14,12): error TS2476: A const enum member can only be accessed using a string literal. tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(16,1): error TS2322: Type '"string"' is not assignable to type 'G'. -tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(18,3): error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. +tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(18,3): error TS2540: Cannot assign to 'B' because it is a read-only property. ==== tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts (4 errors) ==== @@ -30,5 +30,5 @@ tests/cases/conformance/constEnums/constEnumPropertyAccess2.ts(18,3): error TS25 function foo(x: G) { } G.B = 3; ~ -!!! error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'B' because it is a read-only property. \ No newline at end of file diff --git a/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt b/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt index 284e15c5193..a0fc95c6fb0 100644 --- a/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(6,31): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(7,29): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(10,9): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(6,31): error TS2540: Cannot assign to 'A' because it is a read-only property. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(7,29): error TS2540: Cannot assign to 'A' because it is a read-only property. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(10,9): error TS2540: Cannot assign to 'A' because it is a read-only property. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,1): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,1): error TS2542: Index signature in type 'typeof ENUM1' only permits reading. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,7): error TS2304: Cannot find name 'A'. @@ -14,15 +14,15 @@ tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOp // expression var ResultIsNumber1 = --ENUM1["A"]; ~~~ -!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'A' because it is a read-only property. var ResultIsNumber2 = ENUM1.A--; ~ -!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'A' because it is a read-only property. // miss assignment operator --ENUM1["A"]; ~~~ -!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'A' because it is a read-only property. ENUM1[A]--; ~~~~~~~~ diff --git a/tests/baselines/reference/enumMergeWithExpando.errors.txt b/tests/baselines/reference/enumMergeWithExpando.errors.txt index 7911206650c..586a25c69bf 100644 --- a/tests/baselines/reference/enumMergeWithExpando.errors.txt +++ b/tests/baselines/reference/enumMergeWithExpando.errors.txt @@ -1,5 +1,5 @@ -tests/cases/conformance/salsa/enums.js(2,10): error TS2540: Cannot assign to 'DESC' because it is a constant or a read-only property. -tests/cases/conformance/salsa/enums.js(3,10): error TS2540: Cannot assign to 'ASC' because it is a constant or a read-only property. +tests/cases/conformance/salsa/enums.js(2,10): error TS2540: Cannot assign to 'DESC' because it is a read-only property. +tests/cases/conformance/salsa/enums.js(3,10): error TS2540: Cannot assign to 'ASC' because it is a read-only property. ==== tests/cases/conformance/salsa/lovefield-ts.d.ts (0 errors) ==== @@ -12,8 +12,8 @@ tests/cases/conformance/salsa/enums.js(3,10): error TS2540: Cannot assign to 'AS lf.Order = {} lf.Order.DESC = 0; ~~~~ -!!! error TS2540: Cannot assign to 'DESC' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'DESC' because it is a read-only property. lf.Order.ASC = 1; ~~~ -!!! error TS2540: Cannot assign to 'ASC' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'ASC' because it is a read-only property. \ No newline at end of file diff --git a/tests/baselines/reference/externalModuleImmutableBindings.errors.txt b/tests/baselines/reference/externalModuleImmutableBindings.errors.txt index d6a2be707e0..832ce01f751 100644 --- a/tests/baselines/reference/externalModuleImmutableBindings.errors.txt +++ b/tests/baselines/reference/externalModuleImmutableBindings.errors.txt @@ -1,23 +1,23 @@ -tests/cases/compiler/f2.ts(6,7): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/f2.ts(7,7): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/f2.ts(6,7): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(7,7): error TS2540: Cannot assign to 'x' because it is a read-only property. tests/cases/compiler/f2.ts(8,7): error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. -tests/cases/compiler/f2.ts(11,7): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/f2.ts(12,7): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/f2.ts(16,8): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/f2.ts(17,8): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/f2.ts(11,7): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(12,7): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(16,8): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(17,8): error TS2540: Cannot assign to 'x' because it is a read-only property. tests/cases/compiler/f2.ts(18,8): error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. -tests/cases/compiler/f2.ts(21,8): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/f2.ts(22,8): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/f2.ts(26,12): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/f2.ts(27,12): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/f2.ts(28,12): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/f2.ts(29,12): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/f2.ts(21,8): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(22,8): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(26,12): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(27,12): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(28,12): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(29,12): error TS2540: Cannot assign to 'x' because it is a read-only property. tests/cases/compiler/f2.ts(30,12): error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. tests/cases/compiler/f2.ts(31,12): error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. -tests/cases/compiler/f2.ts(35,13): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/f2.ts(36,13): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/f2.ts(37,13): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/compiler/f2.ts(38,13): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/compiler/f2.ts(35,13): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(36,13): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(37,13): error TS2540: Cannot assign to 'x' because it is a read-only property. +tests/cases/compiler/f2.ts(38,13): error TS2540: Cannot assign to 'x' because it is a read-only property. tests/cases/compiler/f2.ts(39,13): error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. tests/cases/compiler/f2.ts(40,13): error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. @@ -33,10 +33,10 @@ tests/cases/compiler/f2.ts(40,13): error TS2339: Property 'blah' does not exist stuff.x = 0; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. stuff['x'] = 1; ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. stuff.blah = 2; ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. @@ -44,19 +44,19 @@ tests/cases/compiler/f2.ts(40,13): error TS2339: Property 'blah' does not exist stuff.x++; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. stuff['x']++; ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. stuff['blah']++; stuff[n]++; (stuff.x) = 0; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. (stuff['x']) = 1; ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. (stuff.blah) = 2; ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. @@ -64,25 +64,25 @@ tests/cases/compiler/f2.ts(40,13): error TS2339: Property 'blah' does not exist (stuff.x)++; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. (stuff['x'])++; ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. (stuff['blah'])++; (stuff[n])++; for (stuff.x in []) {} ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. for (stuff.x of []) {} ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. for (stuff['x'] in []) {} ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. for (stuff['x'] of []) {} ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. for (stuff.blah in []) {} ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. @@ -94,16 +94,16 @@ tests/cases/compiler/f2.ts(40,13): error TS2339: Property 'blah' does not exist for ((stuff.x) in []) {} ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. for ((stuff.x) of []) {} ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. for ((stuff['x']) in []) {} ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. for ((stuff['x']) of []) {} ~~~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. for ((stuff.blah) in []) {} ~~~~ !!! error TS2339: Property 'blah' does not exist on type 'typeof import("tests/cases/compiler/f1")'. diff --git a/tests/baselines/reference/importsImplicitlyReadonly.errors.txt b/tests/baselines/reference/importsImplicitlyReadonly.errors.txt index aad8480a77a..f760e08f36a 100644 --- a/tests/baselines/reference/importsImplicitlyReadonly.errors.txt +++ b/tests/baselines/reference/importsImplicitlyReadonly.errors.txt @@ -1,7 +1,7 @@ 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(8,4): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. -tests/cases/conformance/externalModules/b.ts(9,4): error TS2540: Cannot assign to 'y' because it is a constant or a read-only property. +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. ==== tests/cases/conformance/externalModules/b.ts (4 errors) ==== @@ -18,10 +18,10 @@ tests/cases/conformance/externalModules/b.ts(9,4): error TS2540: Cannot assign t !!! error TS2539: Cannot assign to 'y' because it is not a variable. a1.x = 1; // Error ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. a1.y = 1; // Error ~ -!!! error TS2540: Cannot assign to 'y' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'y' because it is a read-only property. a2.x = 1; a2.y = 1; a3.x = 1; diff --git a/tests/baselines/reference/incrementOperatorWithEnumType.errors.txt b/tests/baselines/reference/incrementOperatorWithEnumType.errors.txt index 8fdbc343562..eb1d0955a92 100644 --- a/tests/baselines/reference/incrementOperatorWithEnumType.errors.txt +++ b/tests/baselines/reference/incrementOperatorWithEnumType.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(6,31): error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(7,29): error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(10,9): error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. -tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(12,7): error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(6,31): error TS2540: Cannot assign to 'B' because it is a read-only property. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(7,29): error TS2540: Cannot assign to 'B' because it is a read-only property. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(10,9): error TS2540: Cannot assign to 'B' because it is a read-only property. +tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts(12,7): error TS2540: Cannot assign to 'B' because it is a read-only property. ==== tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOperatorWithEnumType.ts (4 errors) ==== @@ -12,16 +12,16 @@ tests/cases/conformance/expressions/unaryOperators/incrementOperator/incrementOp // expression var ResultIsNumber1 = ++ENUM1["B"]; ~~~ -!!! error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'B' because it is a read-only property. var ResultIsNumber2 = ENUM1.B++; ~ -!!! error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'B' because it is a read-only property. // miss assignment operator ++ENUM1["B"]; ~~~ -!!! error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'B' because it is a read-only property. ENUM1.B++; ~ -!!! error TS2540: Cannot assign to 'B' because it is a constant or a read-only property. \ No newline at end of file +!!! error TS2540: Cannot assign to 'B' because it is a read-only property. \ No newline at end of file diff --git a/tests/baselines/reference/intersectionTypeReadonly.errors.txt b/tests/baselines/reference/intersectionTypeReadonly.errors.txt index 88ca9cb3b0c..6aed59d9d91 100644 --- a/tests/baselines/reference/intersectionTypeReadonly.errors.txt +++ b/tests/baselines/reference/intersectionTypeReadonly.errors.txt @@ -1,8 +1,8 @@ -tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(17,6): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. -tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(19,11): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. -tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(21,9): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. -tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(23,15): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. -tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(25,15): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(17,6): error TS2540: Cannot assign to 'value' because it is a read-only property. +tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(19,11): error TS2540: Cannot assign to 'value' because it is a read-only property. +tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(21,9): error TS2540: Cannot assign to 'value' because it is a read-only property. +tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(23,15): error TS2540: Cannot assign to 'value' because it is a read-only property. +tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(25,15): error TS2540: Cannot assign to 'value' because it is a read-only property. ==== tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts (5 errors) ==== @@ -24,21 +24,21 @@ tests/cases/conformance/types/intersection/intersectionTypeReadonly.ts(25,15): e let base: Base; base.value = 12 // error, lhs can't be a readonly property ~~~~~ -!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'value' because it is a read-only property. let identical: Base & Identical; identical.value = 12; // error, lhs can't be a readonly property ~~~~~ -!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'value' because it is a read-only property. let mutable: Base & Mutable; mutable.value = 12; // error, lhs can't be a readonly property ~~~~~ -!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'value' because it is a read-only property. let differentType: Base & DifferentType; differentType.value = 12; // error, lhs can't be a readonly property ~~~~~ -!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'value' because it is a read-only property. let differentName: Base & DifferentName; differentName.value = 12; // error, property 'value' doesn't exist ~~~~~ -!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'value' because it is a read-only property. \ No newline at end of file diff --git a/tests/baselines/reference/invalidUndefinedAssignments.errors.txt b/tests/baselines/reference/invalidUndefinedAssignments.errors.txt index b0a30f2dff3..223835f2027 100644 --- a/tests/baselines/reference/invalidUndefinedAssignments.errors.txt +++ b/tests/baselines/reference/invalidUndefinedAssignments.errors.txt @@ -1,5 +1,5 @@ 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(5,3): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +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(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. @@ -15,7 +15,7 @@ tests/cases/conformance/types/primitives/undefined/invalidUndefinedAssignments.t !!! error TS2539: Cannot assign to 'E' because it is not a variable. E.A = x; ~ -!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'A' because it is a read-only property. class C { foo: string } var f: C; diff --git a/tests/baselines/reference/mappedTypes6.errors.txt b/tests/baselines/reference/mappedTypes6.errors.txt index 843a59eecb5..f053ae313c5 100644 --- a/tests/baselines/reference/mappedTypes6.errors.txt +++ b/tests/baselines/reference/mappedTypes6.errors.txt @@ -19,9 +19,9 @@ tests/cases/conformance/types/mapped/mappedTypes6.ts(105,1): error TS2322: Type Property 'c' is missing in type '{ a: number; b: number; }'. tests/cases/conformance/types/mapped/mappedTypes6.ts(106,1): error TS2322: Type '{ a: number; b: number; c: number; }' is not assignable to type 'Required'. Property 'd' is missing in type '{ a: number; b: number; c: number; }'. -tests/cases/conformance/types/mapped/mappedTypes6.ts(116,4): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. -tests/cases/conformance/types/mapped/mappedTypes6.ts(119,4): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. -tests/cases/conformance/types/mapped/mappedTypes6.ts(120,4): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +tests/cases/conformance/types/mapped/mappedTypes6.ts(116,4): error TS2540: Cannot assign to 'b' because it is a read-only property. +tests/cases/conformance/types/mapped/mappedTypes6.ts(119,4): error TS2540: Cannot assign to 'a' because it is a read-only property. +tests/cases/conformance/types/mapped/mappedTypes6.ts(120,4): error TS2540: Cannot assign to 'b' because it is a read-only property. ==== tests/cases/conformance/types/mapped/mappedTypes6.ts (19 errors) ==== @@ -179,15 +179,15 @@ tests/cases/conformance/types/mapped/mappedTypes6.ts(120,4): error TS2540: Canno x3.a = 1; x3.b = 1; // Error ~ -!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'b' because it is a read-only property. declare let x4: Readonly; x4.a = 1; // Error ~ -!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'a' because it is a read-only property. x4.b = 1; // Error ~ -!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'b' because it is a read-only property. declare let x5: Readwrite; x5.a = 1; diff --git a/tests/baselines/reference/objectFreeze.errors.txt b/tests/baselines/reference/objectFreeze.errors.txt index 48f41143d61..f89ef42f4c7 100644 --- a/tests/baselines/reference/objectFreeze.errors.txt +++ b/tests/baselines/reference/objectFreeze.errors.txt @@ -1,6 +1,6 @@ tests/cases/compiler/objectFreeze.ts(9,1): error TS2322: Type 'string' is not assignable to type 'number'. tests/cases/compiler/objectFreeze.ts(9,1): error TS2542: Index signature in type 'ReadonlyArray' only permits reading. -tests/cases/compiler/objectFreeze.ts(12,3): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +tests/cases/compiler/objectFreeze.ts(12,3): error TS2540: Cannot assign to 'b' because it is a read-only property. ==== tests/cases/compiler/objectFreeze.ts (3 errors) ==== @@ -21,5 +21,5 @@ tests/cases/compiler/objectFreeze.ts(12,3): error TS2540: Cannot assign to 'b' b const o = Object.freeze({ a: 1, b: "string" }); o.b = o.a.toString(); ~ -!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'b' because it is a read-only property. \ No newline at end of file diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt index e878d0fd54f..6ce02e5e232 100644 --- a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/amd/nodeModulesMaxDepthExceeded.errors.txt @@ -1,5 +1,5 @@ maxDepthExceeded/root.ts(3,1): error TS2322: Type '"10"' is not assignable to type 'number'. -maxDepthExceeded/root.ts(4,4): error TS2540: Cannot assign to 'rel' because it is a constant or a read-only property. +maxDepthExceeded/root.ts(4,4): error TS2540: Cannot assign to 'rel' because it is a read-only property. ==== maxDepthExceeded/tsconfig.json (0 errors) ==== @@ -36,7 +36,7 @@ maxDepthExceeded/root.ts(4,4): error TS2540: Cannot assign to 'rel' because it i !!! error TS2322: Type '"10"' is not assignable to type 'number'. m1.rel = 42; // Error: Should be boolean ~~~ -!!! error TS2540: Cannot assign to 'rel' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'rel' because it is a read-only property. m1.f2.person.age = "10"; // OK if stopped at 2 modules: person will be "any". diff --git a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt index e878d0fd54f..6ce02e5e232 100644 --- a/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt +++ b/tests/baselines/reference/project/nodeModulesMaxDepthExceeded/node/nodeModulesMaxDepthExceeded.errors.txt @@ -1,5 +1,5 @@ maxDepthExceeded/root.ts(3,1): error TS2322: Type '"10"' is not assignable to type 'number'. -maxDepthExceeded/root.ts(4,4): error TS2540: Cannot assign to 'rel' because it is a constant or a read-only property. +maxDepthExceeded/root.ts(4,4): error TS2540: Cannot assign to 'rel' because it is a read-only property. ==== maxDepthExceeded/tsconfig.json (0 errors) ==== @@ -36,7 +36,7 @@ maxDepthExceeded/root.ts(4,4): error TS2540: Cannot assign to 'rel' because it i !!! error TS2322: Type '"10"' is not assignable to type 'number'. m1.rel = 42; // Error: Should be boolean ~~~ -!!! error TS2540: Cannot assign to 'rel' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'rel' because it is a read-only property. m1.f2.person.age = "10"; // OK if stopped at 2 modules: person will be "any". diff --git a/tests/baselines/reference/readonlyAssignmentInSubclassOfClassExpression.errors.txt b/tests/baselines/reference/readonlyAssignmentInSubclassOfClassExpression.errors.txt index 760cee54025..ceae2b62d6c 100644 --- a/tests/baselines/reference/readonlyAssignmentInSubclassOfClassExpression.errors.txt +++ b/tests/baselines/reference/readonlyAssignmentInSubclassOfClassExpression.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/readonlyAssignmentInSubclassOfClassExpression.ts(4,14): error TS2540: Cannot assign to 'attrib' because it is a constant or a read-only property. +tests/cases/compiler/readonlyAssignmentInSubclassOfClassExpression.ts(4,14): error TS2540: Cannot assign to 'attrib' because it is a read-only property. ==== tests/cases/compiler/readonlyAssignmentInSubclassOfClassExpression.ts (1 errors) ==== @@ -7,7 +7,7 @@ tests/cases/compiler/readonlyAssignmentInSubclassOfClassExpression.ts(4,14): err super() this.attrib = 2 ~~~~~~ -!!! error TS2540: Cannot assign to 'attrib' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'attrib' because it is a read-only property. } } \ No newline at end of file diff --git a/tests/baselines/reference/readonlyConstructorAssignment.errors.txt b/tests/baselines/reference/readonlyConstructorAssignment.errors.txt index 31b4ad969cb..ecd22168d72 100644 --- a/tests/baselines/reference/readonlyConstructorAssignment.errors.txt +++ b/tests/baselines/reference/readonlyConstructorAssignment.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyConstructorAssignment.ts(13,14): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyConstructorAssignment.ts(13,14): error TS2540: Cannot assign to 'x' because it is a read-only property. tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyConstructorAssignment.ts(33,7): error TS2415: Class 'E' incorrectly extends base class 'D'. Property 'x' is private in type 'D' but not in type 'E'. @@ -18,7 +18,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/re // Fails, x is readonly this.x = 1; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. } } diff --git a/tests/baselines/reference/readonlyInConstructorParameters.errors.txt b/tests/baselines/reference/readonlyInConstructorParameters.errors.txt index 15d0d0be8eb..4737812728a 100644 --- a/tests/baselines/reference/readonlyInConstructorParameters.errors.txt +++ b/tests/baselines/reference/readonlyInConstructorParameters.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyInConstructorParameters.ts(4,10): error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyInConstructorParameters.ts(4,10): error TS2540: Cannot assign to 'x' because it is a read-only property. tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyInConstructorParameters.ts(7,26): error TS1029: 'public' modifier must precede 'readonly' modifier. tests/cases/conformance/classes/constructorDeclarations/constructorParameters/readonlyInConstructorParameters.ts(13,10): error TS2341: Property 'x' is private and only accessible within class 'F'. @@ -9,7 +9,7 @@ tests/cases/conformance/classes/constructorDeclarations/constructorParameters/re } new C(1).x = 2; ~ -!!! error TS2540: Cannot assign to 'x' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'x' because it is a read-only property. class E { constructor(readonly public x: number) {} diff --git a/tests/baselines/reference/readonlyMembers.errors.txt b/tests/baselines/reference/readonlyMembers.errors.txt index 9baf37f27e7..bea7932ed4c 100644 --- a/tests/baselines/reference/readonlyMembers.errors.txt +++ b/tests/baselines/reference/readonlyMembers.errors.txt @@ -1,16 +1,16 @@ -tests/cases/compiler/readonlyMembers.ts(6,3): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(7,3): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(16,14): error TS2540: Cannot assign to 'c' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(18,18): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(19,18): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(20,18): error TS2540: Cannot assign to 'c' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(24,14): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(25,14): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(26,14): error TS2540: Cannot assign to 'c' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(35,3): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(39,3): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(48,3): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. -tests/cases/compiler/readonlyMembers.ts(55,3): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +tests/cases/compiler/readonlyMembers.ts(6,3): error TS2540: Cannot assign to 'a' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(7,3): error TS2540: Cannot assign to 'b' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(16,14): error TS2540: Cannot assign to 'c' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(18,18): error TS2540: Cannot assign to 'a' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(19,18): error TS2540: Cannot assign to 'b' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(20,18): error TS2540: Cannot assign to 'c' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(24,14): error TS2540: Cannot assign to 'a' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(25,14): error TS2540: Cannot assign to 'b' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(26,14): error TS2540: Cannot assign to 'c' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(35,3): error TS2540: Cannot assign to 'a' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(39,3): error TS2540: Cannot assign to 'a' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(48,3): error TS2540: Cannot assign to 'A' because it is a read-only property. +tests/cases/compiler/readonlyMembers.ts(55,3): error TS2540: Cannot assign to 'a' because it is a read-only property. tests/cases/compiler/readonlyMembers.ts(61,1): error TS2542: Index signature in type '{ readonly [x: string]: string; }' only permits reading. tests/cases/compiler/readonlyMembers.ts(64,1): error TS2542: Index signature in type '{ [x: string]: string; readonly [x: number]: string; }' only permits reading. @@ -23,10 +23,10 @@ tests/cases/compiler/readonlyMembers.ts(64,1): error TS2542: Index signature in var x: X = { a: 0 }; x.a = 1; // Error ~ -!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'a' because it is a read-only property. x.b = 1; // Error ~ -!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'b' because it is a read-only property. class C { readonly a: number; @@ -37,29 +37,29 @@ tests/cases/compiler/readonlyMembers.ts(64,1): error TS2542: Index signature in this.b = 1; // Ok this.c = 1; // Error ~ -!!! error TS2540: Cannot assign to 'c' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'c' because it is a read-only property. const f = () => { this.a = 1; // Error ~ -!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'a' because it is a read-only property. this.b = 1; // Error ~ -!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'b' because it is a read-only property. this.c = 1; // Error ~ -!!! error TS2540: Cannot assign to 'c' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'c' because it is a read-only property. } } foo() { this.a = 1; // Error ~ -!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'a' because it is a read-only property. this.b = 1; // Error ~ -!!! error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'b' because it is a read-only property. this.c = 1; // Error ~ -!!! error TS2540: Cannot assign to 'c' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'c' because it is a read-only property. } } @@ -70,13 +70,13 @@ tests/cases/compiler/readonlyMembers.ts(64,1): error TS2542: Index signature in }; o.a = 1; // Error ~ -!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'a' because it is a read-only property. o.b = 1; var p: { readonly a: number, b: number } = { a: 1, b: 1 }; p.a = 1; // Error ~ -!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'a' because it is a read-only property. p.b = 1; var q: { a: number, b: number } = p; q.a = 1; @@ -87,7 +87,7 @@ tests/cases/compiler/readonlyMembers.ts(64,1): error TS2542: Index signature in } E.A = 1; // Error ~ -!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'A' because it is a read-only property. namespace N { export const a = 1; @@ -96,7 +96,7 @@ tests/cases/compiler/readonlyMembers.ts(64,1): error TS2542: Index signature in } N.a = 1; // Error ~ -!!! error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'a' because it is a read-only property. N.b = 1; N.c = 1; diff --git a/tests/baselines/reference/unionTypeReadonly.errors.txt b/tests/baselines/reference/unionTypeReadonly.errors.txt index 8248431a932..0d11c63d17f 100644 --- a/tests/baselines/reference/unionTypeReadonly.errors.txt +++ b/tests/baselines/reference/unionTypeReadonly.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/types/union/unionTypeReadonly.ts(17,6): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. -tests/cases/conformance/types/union/unionTypeReadonly.ts(19,11): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. -tests/cases/conformance/types/union/unionTypeReadonly.ts(21,9): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. -tests/cases/conformance/types/union/unionTypeReadonly.ts(23,15): error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +tests/cases/conformance/types/union/unionTypeReadonly.ts(17,6): error TS2540: Cannot assign to 'value' because it is a read-only property. +tests/cases/conformance/types/union/unionTypeReadonly.ts(19,11): error TS2540: Cannot assign to 'value' because it is a read-only property. +tests/cases/conformance/types/union/unionTypeReadonly.ts(21,9): error TS2540: Cannot assign to 'value' because it is a read-only property. +tests/cases/conformance/types/union/unionTypeReadonly.ts(23,15): error TS2540: Cannot assign to 'value' because it is a read-only property. tests/cases/conformance/types/union/unionTypeReadonly.ts(25,15): error TS2339: Property 'value' does not exist on type 'Base | DifferentName'. Property 'value' does not exist on type 'DifferentName'. @@ -25,19 +25,19 @@ tests/cases/conformance/types/union/unionTypeReadonly.ts(25,15): error TS2339: P let base: Base; base.value = 12 // error, lhs can't be a readonly property ~~~~~ -!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'value' because it is a read-only property. let identical: Base | Identical; identical.value = 12; // error, lhs can't be a readonly property ~~~~~ -!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'value' because it is a read-only property. let mutable: Base | Mutable; mutable.value = 12; // error, lhs can't be a readonly property ~~~~~ -!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'value' because it is a read-only property. let differentType: Base | DifferentType; differentType.value = 12; // error, lhs can't be a readonly property ~~~~~ -!!! error TS2540: Cannot assign to 'value' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'value' because it is a read-only property. let differentName: Base | DifferentName; differentName.value = 12; // error, property 'value' doesn't exist ~~~~~ diff --git a/tests/baselines/reference/unionTypeWithIndexSignature.errors.txt b/tests/baselines/reference/unionTypeWithIndexSignature.errors.txt index e95a184d15a..fb4463bc2d9 100644 --- a/tests/baselines/reference/unionTypeWithIndexSignature.errors.txt +++ b/tests/baselines/reference/unionTypeWithIndexSignature.errors.txt @@ -1,6 +1,6 @@ tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(11,3): error TS2339: Property 'bar' does not exist on type 'Missing'. Property 'bar' does not exist on type '{ [s: string]: string; }'. -tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(14,4): error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property. +tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(14,4): error TS2540: Cannot assign to 'foo' because it is a read-only property. tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(24,1): error TS7017: Element implicitly has an 'any' type because type 'Both' has no index signature. tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(25,1): error TS2322: Type '"not ok"' is not assignable to type 'number'. tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(26,1): error TS7017: Element implicitly has an 'any' type because type 'Both' has no index signature. @@ -25,7 +25,7 @@ tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(26,1): error declare var ro: RO ro.foo = 'not allowed' ~~~ -!!! error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'foo' because it is a read-only property. type Num = { '0': string } | { [n: number]: number } declare var num: Num num[0] = 1 diff --git a/tests/baselines/reference/validNullAssignments.errors.txt b/tests/baselines/reference/validNullAssignments.errors.txt index ae3b0695c9d..e3dd21599b5 100644 --- a/tests/baselines/reference/validNullAssignments.errors.txt +++ b/tests/baselines/reference/validNullAssignments.errors.txt @@ -1,4 +1,4 @@ -tests/cases/conformance/types/primitives/null/validNullAssignments.ts(10,3): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +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(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. @@ -17,7 +17,7 @@ tests/cases/conformance/types/primitives/null/validNullAssignments.ts(30,1): err enum E { A } E.A = null; // error ~ -!!! error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'A' because it is a read-only property. class C { foo: string } var f: C; From 3f4c00c8a6ea4d15dbf4addbcc665875b4fd43c7 Mon Sep 17 00:00:00 2001 From: Alexander T Date: Wed, 7 Nov 2018 10:20:11 +0200 Subject: [PATCH 4/5] resolve conflicts --- tests/baselines/reference/bigintWithLib.errors.txt | 8 ++++---- .../reference/decrementOperatorWithEnumType.errors.txt | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/baselines/reference/bigintWithLib.errors.txt b/tests/baselines/reference/bigintWithLib.errors.txt index 18267e6ffdf..03d1f3f755f 100644 --- a/tests/baselines/reference/bigintWithLib.errors.txt +++ b/tests/baselines/reference/bigintWithLib.errors.txt @@ -2,10 +2,10 @@ tests/cases/compiler/bigintWithLib.ts(4,1): error TS2350: Only a void function c tests/cases/compiler/bigintWithLib.ts(16,33): error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. Type 'number[]' is not assignable to type 'SharedArrayBuffer'. Property 'byteLength' is missing in type 'number[]'. -tests/cases/compiler/bigintWithLib.ts(21,13): error TS2540: Cannot assign to 'length' because it is a constant or a read-only property. +tests/cases/compiler/bigintWithLib.ts(21,13): error TS2540: Cannot assign to 'length' because it is a read-only property. tests/cases/compiler/bigintWithLib.ts(28,35): error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. Type 'number[]' is not assignable to type 'SharedArrayBuffer'. -tests/cases/compiler/bigintWithLib.ts(33,13): error TS2540: Cannot assign to 'length' because it is a constant or a read-only property. +tests/cases/compiler/bigintWithLib.ts(33,13): error TS2540: Cannot assign to 'length' because it is a read-only property. tests/cases/compiler/bigintWithLib.ts(40,25): error TS2345: Argument of type '-1' is not assignable to parameter of type 'bigint'. tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '123' is not assignable to parameter of type 'bigint'. @@ -39,7 +39,7 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 let len: number = bigIntArray.length; bigIntArray.length = 10; // should error ~~~~~~ -!!! error TS2540: Cannot assign to 'length' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'length' because it is a read-only property. let arrayBufferLike: ArrayBufferView = bigIntArray; // Test BigUint64Array @@ -56,7 +56,7 @@ tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '12 len = bigIntArray.length; bigIntArray.length = 10; // should error ~~~~~~ -!!! error TS2540: Cannot assign to 'length' because it is a constant or a read-only property. +!!! error TS2540: Cannot assign to 'length' because it is a read-only property. arrayBufferLike = bigIntArray; // Test added DataView methods diff --git a/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt b/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt index 545f128a53e..51d8f13d5ed 100644 --- a/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt +++ b/tests/baselines/reference/decrementOperatorWithEnumType.errors.txt @@ -1,6 +1,6 @@ -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(6,31): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(7,29): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. -tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(10,9): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(6,31): error TS2540: Cannot assign to 'A' because it is a read-only property. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(7,29): error TS2540: Cannot assign to 'A' because it is a read-only property. +tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(10,9): error TS2540: Cannot assign to 'A' because it is a read-only property. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,1): error TS2356: An arithmetic operand must be of type 'any', 'number', 'bigint' or an enum type. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,1): error TS2542: Index signature in type 'typeof ENUM1' only permits reading. tests/cases/conformance/expressions/unaryOperators/decrementOperator/decrementOperatorWithEnumType.ts(12,7): error TS2304: Cannot find name 'A'. From d3d211486cea43366ce0887ff4478c810065affc Mon Sep 17 00:00:00 2001 From: Alexander T Date: Tue, 13 Nov 2018 10:14:43 +0200 Subject: [PATCH 5/5] update baseline after merge the latest changes from master --- tests/baselines/reference/bigintWithLib.errors.txt | 2 +- tests/baselines/reference/mappedTypes6.errors.txt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/baselines/reference/bigintWithLib.errors.txt b/tests/baselines/reference/bigintWithLib.errors.txt index 2e62258e4ed..993f43d5a05 100644 --- a/tests/baselines/reference/bigintWithLib.errors.txt +++ b/tests/baselines/reference/bigintWithLib.errors.txt @@ -1,7 +1,7 @@ tests/cases/compiler/bigintWithLib.ts(4,1): error TS2350: Only a void function can be called with the 'new' keyword. tests/cases/compiler/bigintWithLib.ts(16,33): error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag] -tests/cases/compiler/bigintWithLib.ts(21,13): error TS2540: Cannot assign to 'length' because it is a constant or a read-only property. +tests/cases/compiler/bigintWithLib.ts(21,13): error TS2540: Cannot assign to 'length' because it is a read-only property. tests/cases/compiler/bigintWithLib.ts(28,35): error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'. Type 'number[]' is not assignable to type 'SharedArrayBuffer'. tests/cases/compiler/bigintWithLib.ts(33,13): error TS2540: Cannot assign to 'length' because it is a read-only property. diff --git a/tests/baselines/reference/mappedTypes6.errors.txt b/tests/baselines/reference/mappedTypes6.errors.txt index d69ee2fe4ef..cbe4c58d27e 100644 --- a/tests/baselines/reference/mappedTypes6.errors.txt +++ b/tests/baselines/reference/mappedTypes6.errors.txt @@ -15,9 +15,9 @@ tests/cases/conformance/types/mapped/mappedTypes6.ts(92,1): error TS2741: Proper tests/cases/conformance/types/mapped/mappedTypes6.ts(104,1): error TS2739: Type '{ a: number; }' is missing the following properties from type 'Required': b, c, d tests/cases/conformance/types/mapped/mappedTypes6.ts(105,1): error TS2739: Type '{ a: number; b: number; }' is missing the following properties from type 'Required': c, d tests/cases/conformance/types/mapped/mappedTypes6.ts(106,1): error TS2741: Property 'd' is missing in type '{ a: number; b: number; c: number; }' but required in type 'Required'. -tests/cases/conformance/types/mapped/mappedTypes6.ts(116,4): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. -tests/cases/conformance/types/mapped/mappedTypes6.ts(119,4): error TS2540: Cannot assign to 'a' because it is a constant or a read-only property. -tests/cases/conformance/types/mapped/mappedTypes6.ts(120,4): error TS2540: Cannot assign to 'b' because it is a constant or a read-only property. +tests/cases/conformance/types/mapped/mappedTypes6.ts(116,4): error TS2540: Cannot assign to 'b' because it is a read-only property. +tests/cases/conformance/types/mapped/mappedTypes6.ts(119,4): error TS2540: Cannot assign to 'a' because it is a read-only property. +tests/cases/conformance/types/mapped/mappedTypes6.ts(120,4): error TS2540: Cannot assign to 'b' because it is a read-only property. ==== tests/cases/conformance/types/mapped/mappedTypes6.ts (19 errors) ====