D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15785 - [DMD HEAD] Spurious warning when calling protected super
Summary: [DMD HEAD] Spurious warning when calling protected super
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2016-03-10 23:19 UTC by Vladimir Panteleev
Modified: 2016-03-19 08:34 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Vladimir Panteleev 2016-03-10 23:19:20 UTC
////////// 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 Martin Nowak 2016-03-12 07:21:59 UTC
OK, I missed that DotIdExp on super also needs to allow protected access just like looking in base classes.
Comment 3 github-bugzilla 2016-03-19 08:34:10 UTC
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