mirror of
https://github.com/swc-project/swc.git
synced 2024-12-18 19:21:33 +03:00
30 lines
527 B
TypeScript
30 lines
527 B
TypeScript
// @strict: true
|
|
// @target: es6
|
|
|
|
class A {
|
|
#foo = true;
|
|
static #baz = 10;
|
|
static #m() {}
|
|
method(thing: any) {
|
|
thing.#foo; // OK
|
|
thing.#m();
|
|
thing.#baz;
|
|
thing.#bar; // Error
|
|
thing.#foo();
|
|
}
|
|
methodU(thing: unknown) {
|
|
thing.#foo;
|
|
thing.#m();
|
|
thing.#baz;
|
|
thing.#bar;
|
|
thing.#foo();
|
|
}
|
|
methodN(thing: never) {
|
|
thing.#foo;
|
|
thing.#m();
|
|
thing.#baz;
|
|
thing.#bar;
|
|
thing.#foo();
|
|
}
|
|
};
|