We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I think the below should be allowed.
class A { protected constructor() { } } class B extends A { static create() { new B(); // ERROR, but should not error. } }
I wanted to override a static factory and customise it a bit. But it seems like I wasn't allowed to do it.
And my motivation is that private constructors are accessible on a class's static methods.
class A { static create() { new this(); } protected constructor() { } }
And a natural extension of the private case is to allow protected constructors on subclasses's static methods.
The text was updated successfully, but these errors were encountered:
Definitely a bug; this should be equivalent to the allowed
class A { protected constructor() { } } class B extends A { protected constructor() { super(); } static create() { new B(); // OK } }
Sorry, something went wrong.
sandersn
No branches or pull requests
I think the below should be allowed.
I wanted to override a static factory and customise it a bit. But it seems like I wasn't allowed to do it.
And my motivation is that private constructors are accessible on a class's static methods.
And a natural extension of the private case is to allow protected constructors on subclasses's static methods.
The text was updated successfully, but these errors were encountered: