TypeScript/tests/baselines/reference/assignmentLHSIsValue.errors.txt
2014-07-12 17:30:19 -07:00

151 lines
4.2 KiB
Plaintext

==== tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts (40 errors) ====
// expected error for all the LHS of assignments
var value;
// this
class C {
constructor() { this = value; }
~~~~
!!! Invalid left-hand side of assignment expression.
foo() { this = value; }
~~~~
!!! Invalid left-hand side of assignment expression.
static sfoo() { this = value; }
~~~~
!!! Invalid left-hand side of assignment expression.
}
function foo() { this = value; }
~~~~
!!! Invalid left-hand side of assignment expression.
this = value;
~~~~
!!! Invalid left-hand side of assignment expression.
// identifiers: module, class, enum, function
module M { export var a; }
M = value;
~
!!! Invalid left-hand side of assignment expression.
C = value;
~
!!! Invalid left-hand side of assignment expression.
enum E { }
E = value;
~
!!! Invalid left-hand side of assignment expression.
foo = value;
~~~
!!! Invalid left-hand side of assignment expression.
// literals
null = value;
~~~~
!!! Invalid left-hand side of assignment expression.
true = value;
~~~~
!!! Invalid left-hand side of assignment expression.
false = value;
~~~~~
!!! Invalid left-hand side of assignment expression.
0 = value;
~
!!! Invalid left-hand side of assignment expression.
'' = value;
~~
!!! Invalid left-hand side of assignment expression.
/d+/ = value;
~~~~
!!! Invalid left-hand side of assignment expression.
// object literals
{ a: 0} = value;
~
!!! Declaration or statement expected.
// array literals
['', ''] = value;
~~~~~~~~
!!! Invalid left-hand side of assignment expression.
// super
class Derived extends C {
constructor() { super(); super = value; }
~
!!! 'super' must be followed by argument list or member access.
~~~~~
!!! Invalid left-hand side of assignment expression.
foo() { super = value }
~
!!! 'super' must be followed by argument list or member access.
~~~~~
!!! Invalid left-hand side of assignment expression.
static sfoo() { super = value; }
~
!!! 'super' must be followed by argument list or member access.
~~~~~
!!! Invalid left-hand side of assignment expression.
}
// function expression
function bar() { } = value;
~
!!! Declaration or statement expected.
() => { } = value;
~
!!! ';' expected.
// function calls
foo() = value;
~~~~~
!!! Invalid left-hand side of assignment expression.
// parentheses, the containted expression is value
(this) = value;
~~~~~~
!!! Invalid left-hand side of assignment expression.
(M) = value;
~~~
!!! Invalid left-hand side of assignment expression.
(C) = value;
~~~
!!! Invalid left-hand side of assignment expression.
(E) = value;
~~~
!!! Invalid left-hand side of assignment expression.
(foo) = value;
~~~~~
!!! Invalid left-hand side of assignment expression.
(null) = value;
~~~~~~
!!! Invalid left-hand side of assignment expression.
(true) = value;
~~~~~~
!!! Invalid left-hand side of assignment expression.
(0) = value;
~~~
!!! Invalid left-hand side of assignment expression.
('') = value;
~~~~
!!! Invalid left-hand side of assignment expression.
(/d+/) = value;
~~~~~~
!!! Invalid left-hand side of assignment expression.
({}) = value;
~~~~
!!! Invalid left-hand side of assignment expression.
([]) = value;
~~~~
!!! Invalid left-hand side of assignment expression.
(function baz() { }) = value;
~~~~~~~~~~~~~~~~~~~~
!!! Invalid left-hand side of assignment expression.
(foo()) = value;
~~~~~~~
!!! Invalid left-hand side of assignment expression.