mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
33 lines
1.5 KiB
Plaintext
33 lines
1.5 KiB
Plaintext
classStaticPropertyAccess.ts(10,1): error TS2576: Property '"' does not exist on type 'A'. Did you mean to access the static member 'A["\""]' instead?
|
|
classStaticPropertyAccess.ts(11,1): error TS2576: Property 'y' does not exist on type 'A'. Did you mean to access the static member 'A['y']' instead?
|
|
classStaticPropertyAccess.ts(12,3): error TS2576: Property 'y' does not exist on type 'A'. Did you mean to access the static member 'A.y' instead?
|
|
classStaticPropertyAccess.ts(13,3): error TS2341: Property '_b' is private and only accessible within class 'A'.
|
|
classStaticPropertyAccess.ts(14,3): error TS2339: Property 'a' does not exist on type 'typeof A'.
|
|
|
|
|
|
==== classStaticPropertyAccess.ts (5 errors) ====
|
|
class A {
|
|
public static "\""() {}
|
|
public static x: number = 1;
|
|
public static y: number = 1;
|
|
private static _b: number = 2;
|
|
}
|
|
|
|
const a = new A();
|
|
|
|
a["\""] // Error
|
|
~~~~~~~
|
|
!!! error TS2576: Property '"' does not exist on type 'A'. Did you mean to access the static member 'A["\""]' instead?
|
|
a['y'] // Error
|
|
~~~~~~
|
|
!!! error TS2576: Property 'y' does not exist on type 'A'. Did you mean to access the static member 'A['y']' instead?
|
|
a.y // Error
|
|
~
|
|
!!! error TS2576: Property 'y' does not exist on type 'A'. Did you mean to access the static member 'A.y' instead?
|
|
A._b // Error
|
|
~~
|
|
!!! error TS2341: Property '_b' is private and only accessible within class 'A'.
|
|
A.a
|
|
~
|
|
!!! error TS2339: Property 'a' does not exist on type 'typeof A'.
|
|
|