https://issues.dlang.org/show_bug.cgi?id=17379
Steven Schveighoffer <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|WONTFIX |--- --- Comment #7 from Steven Schveighoffer <[email protected]> --- Reopening, in case someone wishes to tackle this issue with the hairy problems it has. The largest blocking issue to getting this to work is if you have 2 overloads of the same function template (this is completely made up, but something similar would cause problems): auto foo(T)(T t, int x) { static struct Result {T t; int x;} return Result(t, x); } auto foo(T)(T t, string x) { static struct Result {T t; string x;} return Result(t, x); } If you refactor this, then the Result struct doesn't get properly mangled -- it only depends on the template itself. This will produce 2 identical manglings for the 2 functions. Note that if you do actually do the refactoring here (move the Result outside the function), the current compiler simply doesn't redefine the Result struct -- it considers it fully defined in the first overload. So a user would not refactor both, he would get errors on his compilation. But the compiler that was just adjusting the mangling would cause other problems. --
