TypeScript/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt
Hai Lin Zhang e44d39d4eb
Updated error message for TS2539 (#39827)
* Updated error message for TS2539

* Switch to multiple error messages

* inline variable

Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com>
2021-03-11 15:51:15 -08:00

149 lines
8 KiB
Plaintext

tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(4,1): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(5,1): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(13,1): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(14,1): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(15,1): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(17,1): error TS2631: Cannot assign to 'M' because it is a namespace.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(18,2): error TS2631: Cannot assign to 'M' because it is a namespace.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(25,5): error TS2631: Cannot assign to 'M3' because it is a namespace.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(31,11): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(32,13): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(33,13): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(37,1): error TS2630: Cannot assign to 'fn' because it is a function.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(38,2): error TS2630: Cannot assign to 'fn' because it is a function.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(43,5): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(44,5): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(48,5): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(49,5): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(54,5): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(55,5): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(56,5): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(62,1): error TS2628: Cannot assign to 'E' because it is an enum.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(63,2): error TS2628: Cannot assign to 'E' because it is an enum.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(69,1): error TS2629: Cannot assign to 'C' because it is a class.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(70,2): error TS2629: Cannot assign to 'C' because it is a class.
==== tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts (24 errors) ====
var x: number;
x = 3; // OK
(x) = 3; // OK
x = ''; // Error
~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
(x) = ''; // Error
~~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
module M {
export var y: number;
}
M.y = 3; // OK
(M).y = 3; // OK
(M.y) = 3; // OK
M.y = ''; // Error
~~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
(M).y = ''; // Error
~~~~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
(M.y) = ''; // Error
~~~~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
M = { y: 3 }; // Error
~
!!! error TS2631: Cannot assign to 'M' because it is a namespace.
(M) = { y: 3 }; // Error
~
!!! error TS2631: Cannot assign to 'M' because it is a namespace.
module M2 {
export module M3 {
export var x: number;
}
M3 = { x: 3 }; // Error
~~
!!! error TS2631: Cannot assign to 'M3' because it is a namespace.
}
M2.M3 = { x: 3 }; // OK
(M2).M3 = { x: 3 }; // OK
(M2.M3) = { x: 3 }; // OK
M2.M3 = { x: '' }; // Error
~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! related TS6500 tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts:22:20: The expected type comes from property 'x' which is declared here on type 'typeof M3'
(M2).M3 = { x: '' }; // Error
~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! related TS6500 tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts:22:20: The expected type comes from property 'x' which is declared here on type 'typeof M3'
(M2.M3) = { x: '' }; // Error
~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
!!! related TS6500 tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts:22:20: The expected type comes from property 'x' which is declared here on type 'typeof M3'
function fn() { }
fn = () => 3; // Bug 823548: Should be error (fn is not a reference)
~~
!!! error TS2630: Cannot assign to 'fn' because it is a function.
(fn) = () => 3; // Should be error
~~
!!! error TS2630: Cannot assign to 'fn' because it is a function.
function fn2(x: number, y: { t: number }) {
x = 3;
(x) = 3; // OK
x = ''; // Error
~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
(x) = ''; // Error
~~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
(y).t = 3; // OK
(y.t) = 3; // OK
(y).t = ''; // Error
~~~~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
(y.t) = ''; // Error
~~~~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
y['t'] = 3; // OK
(y)['t'] = 3; // OK
(y['t']) = 3; // OK
y['t'] = ''; // Error
~~~~~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
(y)['t'] = ''; // Error
~~~~~~~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
(y['t']) = ''; // Error
~~~~~~~~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
}
enum E {
A
}
E = undefined; // Error
~
!!! error TS2628: Cannot assign to 'E' because it is an enum.
(E) = undefined; // Error
~
!!! error TS2628: Cannot assign to 'E' because it is an enum.
class C {
}
C = undefined; // Error
~
!!! error TS2629: Cannot assign to 'C' because it is a class.
(C) = undefined; // Error
~
!!! error TS2629: Cannot assign to 'C' because it is a class.