Package and virtual functions
Jacob Carlborg
doob at me.com
Wed Jun 13 23:30:26 PDT 2012
On 2012-06-14 00:48, Jonathan M Davis wrote:
> On Thursday, June 14, 2012 00:32:45 BLM768 wrote:
>> For some reason, whenever I declare a method with package
>> visibility, it becomes non-virtual. Is this normal behavior, or
>> is there a bug in DMD 2.059?
>
> Only public and protected functions can be virtual. private and package
> functions are never virtual. This is by design.
>
> - Jonathan M Davis
The docs say:
"All non-static non-private non-template member functions are virtual."
To me that says that methods marked with "package" are virtual. It's
been like that in the documentation forever. So I don't know if "by
design" is correct. I also know that package methods have never been
virtual so I don't know what the actual design is.
This is a common, annoying, problem with D: What is correct when DMD,
the documentation and TDPL all are different?
http://dlang.org/function.html#virtual-functions
--
/Jacob Carlborg
More information about the Digitalmars-d-learn
mailing list