https://issues.dlang.org/show_bug.cgi?id=6574
Kenji Hara <k.hara...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |spec, wrong-code Severity|major |critical --- Comment #4 from Kenji Hara <k.hara...@gmail.com> --- This is a mangling scheme issue and function symbol is confused in link stage. module test; extern(C) int printf(const char*, ...); enum Method { A, B, } void foo(Method method = Method.A)() { pragma(msg, "1: ", foo.mangleof); foo!method(); } void foo(Method method : Method.A)() { pragma(msg, "2: ", foo.mangleof); } void main() { foo(); } foo() instantiates the first version `void foo(Method method = Method.A)()`, then it instantiates the second version `void foo(Method method : Method.A)()`. But the instantiated two functions have exactly same mangled names, so the pragmas print: 1: _D4test24__T3fooVE4test6Methodi1Z3fooFZv 2: _D4test24__T3fooVE4test6Methodi1Z3fooFZv and the foo!method() wrongly call itself. --