TypeScript/tests/baselines/reference/assignmentToParenthesizedIdentifiers.errors.txt

158 lines
8.1 KiB
Plaintext
Raw Normal View History

2014-11-05 21:26:03 +01:00
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 TS2364: Invalid left-hand side of assignment expression.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(18,1): error TS2364: Invalid left-hand side of assignment expression.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(25,5): error TS2364: Invalid left-hand side of assignment expression.
2014-11-05 21:26:03 +01:00
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(31,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'.
Types of property 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
2014-11-05 21:26:03 +01:00
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(32,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'.
Types of property 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
2014-11-05 21:26:03 +01:00
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(33,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'.
Types of property 'x' are incompatible.
Type 'string' is not assignable to type 'number'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(37,1): error TS2364: Invalid left-hand side of assignment expression.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(38,1): error TS2364: Invalid left-hand side of assignment expression.
2014-11-05 21:26:03 +01:00
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 TS2364: Invalid left-hand side of assignment expression.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(63,1): error TS2364: Invalid left-hand side of assignment expression.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(69,1): error TS2364: Invalid left-hand side of assignment expression.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(70,1): error TS2364: Invalid left-hand side of assignment expression.
2014-07-13 01:04:16 +02:00
==== tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts (24 errors) ====
var x: number;
x = 3; // OK
(x) = 3; // OK
x = ''; // Error
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
(x) = ''; // Error
~~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
module M {
export var y: number;
}
M.y = 3; // OK
(M).y = 3; // OK
(M.y) = 3; // OK
M.y = ''; // Error
~~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
(M).y = ''; // Error
~~~~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
(M.y) = ''; // Error
~~~~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
M = { y: 3 }; // Error
~
!!! error TS2364: Invalid left-hand side of assignment expression.
2014-07-13 01:04:16 +02:00
(M) = { y: 3 }; // Error
~~~
!!! error TS2364: Invalid left-hand side of assignment expression.
2014-07-13 01:04:16 +02:00
module M2 {
export module M3 {
export var x: number;
}
M3 = { x: 3 }; // Error
~~
!!! error TS2364: Invalid left-hand side of assignment expression.
2014-07-13 01:04:16 +02:00
}
M2.M3 = { x: 3 }; // OK
(M2).M3 = { x: 3 }; // OK
(M2.M3) = { x: 3 }; // OK
M2.M3 = { x: '' }; // Error
~~~~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'.
!!! error TS2322: Types of property 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
(M2).M3 = { x: '' }; // Error
~~~~~~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'.
!!! error TS2322: Types of property 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
(M2.M3) = { x: '' }; // Error
~~~~~~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'.
!!! error TS2322: Types of property 'x' are incompatible.
!!! error TS2322: Type 'string' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
function fn() { }
fn = () => 3; // Bug 823548: Should be error (fn is not a reference)
~~
!!! error TS2364: Invalid left-hand side of assignment expression.
2014-07-13 01:04:16 +02:00
(fn) = () => 3; // Should be error
~~~~
!!! error TS2364: Invalid left-hand side of assignment expression.
2014-07-13 01:04:16 +02:00
function fn2(x: number, y: { t: number }) {
x = 3;
(x) = 3; // OK
x = ''; // Error
~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
(x) = ''; // Error
~~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
(y).t = 3; // OK
(y.t) = 3; // OK
(y).t = ''; // Error
~~~~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
(y.t) = ''; // Error
~~~~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
y['t'] = 3; // OK
(y)['t'] = 3; // OK
(y['t']) = 3; // OK
y['t'] = ''; // Error
~~~~~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
(y)['t'] = ''; // Error
~~~~~~~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
(y['t']) = ''; // Error
~~~~~~~~
2014-11-05 21:26:03 +01:00
!!! error TS2322: Type 'string' is not assignable to type 'number'.
2014-07-13 01:04:16 +02:00
}
enum E {
A
}
E = undefined; // Error
~
!!! error TS2364: Invalid left-hand side of assignment expression.
2014-07-13 01:04:16 +02:00
(E) = undefined; // Error
~~~
!!! error TS2364: Invalid left-hand side of assignment expression.
2014-07-13 01:04:16 +02:00
class C {
}
C = undefined; // Error
~
!!! error TS2364: Invalid left-hand side of assignment expression.
2014-07-13 01:04:16 +02:00
(C) = undefined; // Error
~~~
!!! error TS2364: Invalid left-hand side of assignment expression.
2014-07-13 01:04:16 +02:00