https://issues.dlang.org/show_bug.cgi?id=15897
Issue ID: 15897
Summary: private base functions not callable from base class
module without type change
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: rejects-valid
Severity: regression
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
Example (from
https://forum.dlang.org/post/[email protected])
module a;
import b;
class Animal
{
private void create() {}
}
void foo(Cat cat)
{
cat.create(); // >> no property create for type 'b.cat'
}
void main() {}
--------------
module b;
import a;
class Cat: Animal {}
Compiles with 2.070
Fails in 2.071.0:
Error: no property 'create' for type 'b.Cat'
If I do this:
void foo(Cat cat)
{
Animal a = cat;
a.create();
}
It now compiles. The user shouldn't have to jump through this hoop, the
compiler is aware of the access of create via the base class.
If you move Cat into the same module, it also compiles.
--