You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
forsaken reported this on 2017-09-12T01:48:32Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=17824
CC List
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.The text was updated successfully, but these errors were encountered: