https://issues.dlang.org/show_bug.cgi?id=8373
Kenji Hara <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |accepts-invalid, pull --- Comment #3 from Kenji Hara <[email protected]> --- (In reply to timon.gehr from comment #0) > DMD 2.059: > auto fun(T...)(T args){return 1;} > template fun(a...){auto fun(T...)(T args){return 2;}} > static assert(fun(0)==1); // error > > The call matches only the first declaration, therefore the overload > resolution > should succeed. https://github.com/D-Programming-Language/dmd/pull/3459 This is order-dependent bug. If you swap the positions of two 'fun's, template fun(a...){auto fun(T...)(T args){return 2;}} auto fun(T...)(T args){return 1;} static assert(fun(0)==1); // error It will cause correct error for ambiguity. test.d(3): Error: test.fun called with argument types (int) matches both: test.d(1): test.fun!().fun!(int).fun(int) and: test.d(2): test.fun!(int).fun(int) --
