Skip to content

Protected constructors accessible in subclass static methods #9904

New issue

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

Merged

Conversation

sandersn
Copy link
Member

Fixes #9734

sandersn added 2 commits July 22, 2016 13:38
in static methods of subclasses
Previously, it was an error to refer to a protected constructor from a
base class, even in a static method where the semantics work. Now it is
not an error in static methods.
if (baseTypes.length) {
const baseType = baseTypes[0];
if (containingFunction &&
containingFunction.flags & NodeFlags.Static &&
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does it matter whether the function is static?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops. I wasn't paying attention and overfit to the example. I see that instance methods should be ok based on your constructor-with-super equivalence example.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@RyanCavanaugh
Copy link
Member

👍

@sandersn sandersn merged commit ac2c41c into master Jul 25, 2016
@sandersn sandersn deleted the protected-constructors-accessible-in-subclass-static-methods branch July 25, 2016 19:38
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants