mirror of
https://github.com/swc-project/swc.git
synced 2024-12-26 15:12:08 +03:00
16 lines
415 B
TypeScript
16 lines
415 B
TypeScript
// @target: es2015
|
|
|
|
class Parent {
|
|
#foo = 3;
|
|
static #bar = 5;
|
|
accessChildProps() {
|
|
new Child().#foo; // OK (`#foo` was added when `Parent`'s constructor was called on `child`)
|
|
Child.#bar; // Error: not found
|
|
}
|
|
}
|
|
|
|
class Child extends Parent {
|
|
#foo = "foo"; // OK (Child's #foo does not conflict, as `Parent`'s `#foo` is not accessible)
|
|
#bar = "bar"; // OK
|
|
}
|