On Friday, 8 April 2016 at 08:26:11 UTC, Daniel Kozak wrote:
On Friday, 8 April 2016 at 06:08:38 UTC, 9il wrote:
On Thursday, 7 April 2016 at 15:55:16 UTC, Steven Schveighoffer wrote:
Wow, totally agree with you. Compiler shouldn't make you jump through this hoop:

void foo(Cat cat)
{
   Animal a = cat;
   a.create();
}

Please file a bug report, not sure why this happened.

-Steve

Why this is a bug? private methods are not virtual, are they? --Ilya

No they are not virtual, so this is not a bug.

I disagree, virtuality has nothing to do with this. After all, moving Cat to the same module as Animal, or making create() public final will make the code compile.

Private symbols can (only) be accessed from the module where they are defined, so anything in the animal module should be able to call create() on a Cat just fine.

Reply via email to