Bug 17824 – wrong visibility deduced for method

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2017-09-12T01:48:32Z
Last change time
2024-12-13T18:54:29Z
Assigned to
No Owner
Creator
forsaken
Moved to GitHub: dmd#19315 →

Comments

Comment #0 by nicolas.jinchereau — 2017-09-12T01:48:32Z
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 by robert.schadek — 2024-12-13T18:54:29Z
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