File: typeOfThisInStaticMembers13%28target%3Des6%29.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 (29 lines) | stat: -rw-r--r-- 2,155 bytes parent folder | download | duplicates (4)
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
tests/cases/conformance/classes/members/instanceAndStaticMembers/typeOfThisInStaticMembers13.ts(4,16): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
tests/cases/conformance/classes/members/instanceAndStaticMembers/typeOfThisInStaticMembers13.ts(4,17): error TS2465: 'this' cannot be referenced in a computed property name.
tests/cases/conformance/classes/members/instanceAndStaticMembers/typeOfThisInStaticMembers13.ts(4,22): error TS2339: Property 'c' does not exist on type 'typeof Inner'.
tests/cases/conformance/classes/members/instanceAndStaticMembers/typeOfThisInStaticMembers13.ts(5,9): error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
tests/cases/conformance/classes/members/instanceAndStaticMembers/typeOfThisInStaticMembers13.ts(5,10): error TS2465: 'this' cannot be referenced in a computed property name.
tests/cases/conformance/classes/members/instanceAndStaticMembers/typeOfThisInStaticMembers13.ts(5,15): error TS2339: Property 'c' does not exist on type 'Inner'.


==== tests/cases/conformance/classes/members/instanceAndStaticMembers/typeOfThisInStaticMembers13.ts (6 errors) ====
    class C {
        static readonly c: "foo" = "foo"
        static bar =  class Inner {
            static [this.c] = 123;
                   ~~~~~~~~
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
                    ~~~~
!!! error TS2465: 'this' cannot be referenced in a computed property name.
                         ~
!!! error TS2339: Property 'c' does not exist on type 'typeof Inner'.
            [this.c] = 123;
            ~~~~~~~~
!!! error TS1166: A computed property name in a class property declaration must have a simple literal type or a 'unique symbol' type.
             ~~~~
!!! error TS2465: 'this' cannot be referenced in a computed property name.
                  ~
!!! error TS2339: Property 'c' does not exist on type 'Inner'.
        }
    }