Bug 14656 – "auto" of "auto ref" spills over to other function
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-06-05T20:00:00Z
Last change time
2015-06-17T21:05:50Z
Assigned to
nobody
Creator
ag0aep6g
Comments
Comment #0 by ag0aep6g — 2015-06-05T20:00:12Z
----
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.
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.