Bug 15785 – [DMD HEAD] Spurious warning when calling protected super

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-03-10T23:19:00Z
Last change time
2016-03-19T08:34:11Z
Keywords
pull
Assigned to
nobody
Creator
dlang-bugzilla

Comments

Comment #0 by dlang-bugzilla — 2016-03-10T23:19:20Z
////////// a.d ////////// class A { protected void f() {} } ////////// b.d ////////// import a; class B : A { override void f() { super.f(); } } ///////////////////////// DMD now complains: b.d(7): Deprecation: a.A.f is not visible from module b Of course this makes no sense - you can override a symbol but not call it? Introduced in https://github.com/D-Programming-Language/dmd/pull/5472
Comment #1 by code — 2016-03-12T07:21:59Z
OK, I missed that DotIdExp on super also needs to allow protected access just like looking in base classes.
Comment #2 by code — 2016-03-16T16:26:42Z
Comment #3 by github-bugzilla — 2016-03-19T08:34:10Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/f8ab4598e6059fa41db025b2881c540510957eb3 fix Issue 15785 - spurious warning when calling protected super - allow access to protected symbols accessible through base class - need to check visibility for qualified lookups from the current scope https://github.com/D-Programming-Language/dmd/commit/a0514fb8f84aa98d6117633b8c8293c545737a40 Merge pull request #5530 from MartinNowak/fix15785 fix Issue 15785 - spurious warning when calling protected super