-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: classesBehavior of various `class` constructs, e.g. mixins or base classesBehavior of various `class` constructs, e.g. mixins or base classesHelp WantedYou can do thisYou can do this
Milestone
Description
π Search Terms
private, protected
π Version & Regression Information
Version 5.6.2
β― Playground Link
π» Code
export class Foo {
protected thisIsProtected = 1;
private thisIsPrivate = 1;
bar():Foo {
const that = this;
return new class extends Foo {
something() {
return that.thisIsPrivate + that.thisIsProtected;
}
}
}
}π Actual behavior
I get a compile error for that.thisIsProtected, but not for that.thisIsPrivate
π Expected behavior
I can access the protected field, like the private
Additional information about the issue
No response
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: classesBehavior of various `class` constructs, e.g. mixins or base classesBehavior of various `class` constructs, e.g. mixins or base classesHelp WantedYou can do thisYou can do this