D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 17824 - wrong visibility deduced for method
Summary: wrong visibility deduced for method
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-12 01:48 UTC by forsaken
Modified: 2024-12-13 18:54 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 forsaken 2017-09-12 01:48:32 UTC
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.
Comment 1 dlangBugzillaToGithub 2024-12-13 18:54:29 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/19315

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB