dmd icon indicating copy to clipboard operation
dmd copied to clipboard

Bug in template mixin

Open andrey-zherikov opened this issue 4 months ago • 3 comments

From https://forum.dlang.org/post/[email protected]:

import std;
mixin template f(int function(int) F){}
mixin template f(void function(int) F){unittest{"void".writeln;}}

//mixin f!((_){}); //FAILS


mixin template g(void function(int) F){unittest{"void".writeln;}}
mixin template g(int function(int) F){}

mixin g!((_){});  //works

Expected behavior: both cases work

andrey-zherikov avatar Jun 14 '25 11:06 andrey-zherikov