IMHO this should rise a compiler error: --- mixin template T() { override string f() { return "T"; } } class A { string f() { return "A"; } } class B: A { mixin T; override string f() { return "B"; } mixin T; } void main() { A b = new B; assert(b.f() == "B"); // This passes } ---
Or, if this shouldn't rise an error, this also should compiles: --- class B: A { mixin T; mixin T; override string f() { return "B"; } } --- Error: function main.B.T!().f multiple overrides of same function
Related: overloads don't appear to be recognized from within mixin templates. --- class X { void x() {} mixin template T() { void x(int y) { x(); } } mixin T; } // app.d(4): Error: function app.X.T!().x (int y) is not callable using argument types ()
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18436 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB