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

wrong visibility deduced for method #19315

Open
dlangBugzillaToGithub opened this issue Sep 12, 2017 · 0 comments
Open

wrong visibility deduced for method #19315

dlangBugzillaToGithub opened this issue Sep 12, 2017 · 0 comments

Comments

@dlangBugzillaToGithub
Copy link

forsaken reported this on 2017-09-12T01:48:32Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=17824

CC List

  • forsaken

Description

module base;
import derived;
class Base {
    private void foo() { }
    void callFoo(Derived d) { d.foo(); }
}
-------
module derived;
import base;
class Derived : Base { }
-------
import base;
import derived;
int main(string[] argv) {
    auto d = new Derived();
    d.callFoo(new Derived());
}

error:
base.d(6): Deprecation: base.Base.foo is not visible from class Derived

The method d.foo() should be callable from inside 'callFoo'. Casting 'd' to 'Base' inside 'callFoo()' before invoking 'foo' suppresses the error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant