fix Issue 15785 - spurious warning when calling protected super#5530
Merged
9rnsr merged 1 commit intodlang:masterfrom Mar 19, 2016
Merged
fix Issue 15785 - spurious warning when calling protected super#55309rnsr merged 1 commit intodlang:masterfrom
9rnsr merged 1 commit intodlang:masterfrom
Conversation
Member
MartinNowak
commented
Mar 15, 2016
- allow access to protected symbols accessible through base class
- need to check visibility for qualified lookups from the current scope
- allow access to protected symbols accessible through base class - need to check visibility for qualified lookups from the current scope
Contributor
|
Member
Author
|
What I missed in #5472 is that checking visibility of a symbol based on the module is sufficient for unqualified lookup b/c base classes are searched via the scope chain and can allow access to protected symbols (see here), but for qualified lookups the visibility needs to be explicitly checked from the lookup scope in order to correctly handle protected symbols. |
| * s = symbol to check for visibility | ||
| * Returns: true if s is visible by origin | ||
| */ | ||
| extern (C++) bool symbolIsVisible(Scope *sc, Dsymbol s) |
Member
Author
There was a problem hiding this comment.
If we'd pass the current scope from Scope.search to Dsymbol.search, then it might be possible to replace the above overloads w/ this newly added function, but I'd like to try that separately of this regression fix.
Contributor
|
LGTM. |
Contributor
|
Auto-merge toggled on |
9rnsr
added a commit
that referenced
this pull request
Mar 19, 2016
fix Issue 15785 - spurious warning when calling protected super
Member
Author
|
Thanks |
Member
|
This pull request may have introduced a regression: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.