Mixin template overloads not working

Rumbu rumbu at rumbu.ro
Fri Dec 3 10:42:37 UTC 2021

class S {}
class A:S {}
class B:S {}

mixin template vmix(T)
     void visit(T t) {}

class Visitor
     void visit(S s) {}
     mixin vmix!A;
     mixin vmix!B;

class AnotherVisitor: Visitor
     override void visit(A a) {}

This will result in error when I try to override mixin generated 
visit(A) in AnotherVisitor.

If A doesn't inherit S, the override in AnotherVisitor works like 
a charm.

Bug or feature? Is there any workaround?

More information about the Digitalmars-d-learn mailing list