mirror of
https://github.com/swc-project/swc.git
synced 2024-11-24 10:12:42 +03:00
16 lines
440 B
TypeScript
16 lines
440 B
TypeScript
// @target: es2015
|
|
|
|
class A {
|
|
#foo = 1;
|
|
static #foo = true; // error (duplicate)
|
|
// because static and instance private names
|
|
// share the same lexical scope
|
|
// https://tc39.es/proposal-class-fields/#prod-ClassBody
|
|
}
|
|
class B {
|
|
static #foo = true;
|
|
test(x: B) {
|
|
x.#foo; // error (#foo is a static property on B, not an instance property)
|
|
}
|
|
}
|