Skip to content

ZNTC1101: Private field must be declared in an enclosing class

Private field must be declared in an enclosing class

Category: Semantic: Private Member

class C { f() { this.#x; } }

Reproduce in Playground →

See the error message for cause and resolution.