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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
=== tests/cases/conformance/classes/members/privateNames/privateNameStaticAccessorsAccess.ts ===
export {}
class A2 {
>A2 : A2
static get #prop() { return ""; }
>#prop : string
>"" : ""
static set #prop(param: string) { }
>#prop : string
>param : string
constructor() {
console.log(A2.#prop);
>console.log(A2.#prop) : void
>console.log : (...data: any[]) => void
>console : Console
>log : (...data: any[]) => void
>A2.#prop : string
>A2 : typeof A2
let a: typeof A2 = A2;
>a : typeof A2
>A2 : typeof A2
>A2 : typeof A2
a.#prop;
>a.#prop : string
>a : typeof A2
function foo (){
>foo : () => void
a.#prop;
>a.#prop : string
>a : typeof A2
}
}
}
A2.#prop; // Error
>A2.#prop : any
>A2 : typeof A2
function foo (){
>foo : () => void
A2.#prop; // Error
>A2.#prop : any
>A2 : typeof A2
}
class B2 {
>B2 : B2
m() {
>m : () => void
A2.#prop;
>A2.#prop : any
>A2 : typeof A2
}
}
|