Skip to content
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

Error message clarification for accessing protected members #42599

Merged
merged 1 commit into from
Mar 9, 2021

Conversation

tarikeshaq
Copy link
Contributor

Fixes #35989

Adds clarification on the error when accessing protected members of a superclass. Based on this #35989 (comment).

Old message (from the issue):

Property 'doTransfer' is protected and only accessible through an instance of class 'HostileBankAccount'.

Adding the actual instance, so new message:

Property 'doTransfer' is protected and only accessible through an instance of class 'HostileBankAccount'. This is an instance of 'BankAccount'.

Rendered view of how it looks like when the compiler is run:
protectedError

This is my first contribution here so happy to make any changes (or close this if it's not needed, the ticket didn't have much activity lately 😄)

@ghost
Copy link

ghost commented Feb 2, 2021

CLA assistant check
All CLA requirements met.

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Feb 2, 2021
Copy link
Member

@sandersn sandersn left a comment

Choose a reason for hiding this comment

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

Very nice -- I requested an elaboration but now that I see it on a single line, I think I like it better that way.

@sandersn sandersn merged commit 626e78c into microsoft:master Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Bad error message when trying to access protected property of super class type
3 participants