20 lines
744 B
Plaintext
20 lines
744 B
Plaintext
|
tests/cases/conformance/classes/members/privateNames/privateNameStaticAccessors.ts(9,12): error TS2540: Cannot assign to '#roProp' because it is a read-only property.
|
||
|
|
||
|
|
||
|
==== tests/cases/conformance/classes/members/privateNames/privateNameStaticAccessors.ts (1 errors) ====
|
||
|
class A1 {
|
||
|
static get #prop() { return ""; }
|
||
|
static set #prop(param: string) { }
|
||
|
|
||
|
static get #roProp() { return ""; }
|
||
|
|
||
|
constructor(name: string) {
|
||
|
A1.#prop = "";
|
||
|
A1.#roProp = ""; // Error
|
||
|
~~~~~~~
|
||
|
!!! error TS2540: Cannot assign to '#roProp' because it is a read-only property.
|
||
|
console.log(A1.#prop);
|
||
|
console.log(A1.#roProp);
|
||
|
}
|
||
|
}
|
||
|
|