Inheritance of mixin

Basile B. via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 28 05:43:23 PDT 2016


On Thursday, 28 April 2016 at 12:41:57 UTC, Basile B. wrote:
> On Thursday, 28 April 2016 at 10:21:34 UTC, Andrew Benton wrote:
>> [...]
>
> This is a common error with mixin template. The static things 
> gets only evaluated once. If you want to be evaluated in each 
> class type you need a true template that get an instance in 
> each class. However the method then **wont be virtual** !!
>
> [...]

Oops actually, type is infered:

void main()
{
     import std.stdio;
     writeln((new Base).writeName); // an UUID
     writeln((new Inheritor).writeName); // test
}


More information about the Digitalmars-d mailing list