On Wednesday, 10 April 2013 at 10:53:26 UTC, Regan Heath wrote:
Hmm..
A is not final.
True. But, I don't see how this matters.
A has no internal linkage. It can be inherited from in other
compilation unit.
False. In this first example we are compiling A and B together
(into an exe - I left that off) so the compiler has all sources
and all uses of all methods of A (and B).
notVirt is virtual.
It may actually be (I don't know) but it certainly does not
have to be (compiler has all sources/uses) and my impression
was that it /should/ not be.
R
If it is compiled all at once and compiled into executable binary
than yes, you examples are valid and compiler _MAY_ omit virtual.
But
a) DMD doesn't do it as far as I am aware.
b) It is a quite uncommon and restrictive build setup.