---- void unaryFun()(auto ref int a) pure nothrow @safe @nogc {} alias Identity(F) = F; void main() { unaryFun!()(41); static void fun(int n) pure nothrow @safe @nogc {} alias F = typeof(fun); pragma(msg, F); /* ...(int n) */ pragma(msg, Identity!F); /* ...(auto int) */ } ---- Shouldn't print "auto" as fun has no "auto" on the parameter.
Forgot to link the forum discussion: http://forum.dlang.org/post/jqyklfqhmryumilawzod@forum.dlang.org
problem is that auto does not affect type mangling, so when type is lookup in table it will return wrong type. To fix it we must make it ilegal to use auto int or change type mangling.
https://github.com/D-Programming-Language/dmd/pull/4728
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ee8edc229c91171e5d4c4db7a0e6908c7846cb6d fix Issue 14656 - "auto" of "auto ref" spills over to other function https://github.com/D-Programming-Language/dmd/commit/a6065817b8fad6ca18eaf62323bb804633fa9cbe Merge pull request #4728 from Kozzi11/issue14656 fix Issue 14656 - "auto" of "auto ref" spills over to other function
Commits pushed to stable at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ee8edc229c91171e5d4c4db7a0e6908c7846cb6d fix Issue 14656 - "auto" of "auto ref" spills over to other function https://github.com/D-Programming-Language/dmd/commit/a6065817b8fad6ca18eaf62323bb804633fa9cbe Merge pull request #4728 from Kozzi11/issue14656