Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Protected constructors accessible in subclass static methods#9904

Merged
sandersn merged 3 commits into
mastermicrosoft/TypeScript:masterfrom
protected-constructors-accessible-in-subclass-static-methodsmicrosoft/TypeScript:protected-constructors-accessible-in-subclass-static-methodsCopy head branch name to clipboard
Jul 25, 2016
Merged

Protected constructors accessible in subclass static methods#9904
sandersn merged 3 commits into
mastermicrosoft/TypeScript:masterfrom
protected-constructors-accessible-in-subclass-static-methodsmicrosoft/TypeScript:protected-constructors-accessible-in-subclass-static-methodsCopy head branch name to clipboard

Conversation

@sandersn

Copy link
Copy Markdown
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.
Comment thread src/compiler/checker.ts Outdated
if (baseTypes.length) {
const baseType = baseTypes[0];
if (containingFunction &&
containingFunction.flags & NodeFlags.Static &&

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.