1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
tests/cases/conformance/classes/members/privateNames/privateNameMethodsDerivedClasses.ts(9,23): error TS18013: Property '#prop' is not accessible outside class 'Base' because it has a private identifier.
==== tests/cases/conformance/classes/members/privateNames/privateNameMethodsDerivedClasses.ts (1 errors) ====
class Base {
#prop(): number{ return 123; }
static method(x: Derived) {
console.log(x.#prop());
}
}
class Derived extends Base {
static method(x: Derived) {
console.log(x.#prop());
~~~~~
!!! error TS18013: Property '#prop' is not accessible outside class 'Base' because it has a private identifier.
}
}
|