File: enumBasics2.errors.txt

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (33 lines) | stat: -rw-r--r-- 1,324 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
tests/cases/compiler/enumBasics2.ts(4,9): error TS2339: Property 'b' does not exist on type 'Foo.a'.
tests/cases/compiler/enumBasics2.ts(5,9): error TS2339: Property 'a' does not exist on type 'Foo.b'.
tests/cases/compiler/enumBasics2.ts(6,9): error TS2339: Property 'x' does not exist on type 'Foo.y'.
tests/cases/compiler/enumBasics2.ts(6,15): error TS2339: Property 'x' does not exist on type 'Foo.a'.
tests/cases/compiler/enumBasics2.ts(13,13): error TS2339: Property 'a' does not exist on type 'Foo.a'.


==== tests/cases/compiler/enumBasics2.ts (5 errors) ====
    enum Foo {
      a = 2,
      b = 3,
      x = a.b,       // should error
            ~
!!! error TS2339: Property 'b' does not exist on type 'Foo.a'.
      y = b.a,       // should error
            ~
!!! error TS2339: Property 'a' does not exist on type 'Foo.b'.
      z = y.x * a.x, // should error
            ~
!!! error TS2339: Property 'x' does not exist on type 'Foo.y'.
                  ~
!!! error TS2339: Property 'x' does not exist on type 'Foo.a'.
    }
    
    enum Bar {
      a = (1).valueOf(),   // ok
      b = Foo.a,           // ok
      c = Foo.a.valueOf(), // ok
      d = Foo.a.a,         // should error
                ~
!!! error TS2339: Property 'a' does not exist on type 'Foo.a'.
    }