File: assignToEnum.errors.txt

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (22 lines) | stat: -rw-r--r-- 1,082 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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 errors) ====
    enum A { foo, bar }
    A = undefined;  // invalid LHS
    ~
!!! error TS2539: Cannot assign to 'A' because it is not a variable.
    A = A.bar;      // invalid LHS
    ~
!!! 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.
    A.foo = A.bar;  // invalid LHS
      ~~~
!!! error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property.