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.
Comment #1 by ag0aep6g — 2015-06-05T20:08:32Z
Forgot to link the forum discussion: http://forum.dlang.org/post/[email protected]
Comment #2 by kozzi11 — 2015-06-07T15:51:12Z
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.
Comment #3 by kozzi11 — 2015-06-08T14:40:15Z
Comment #4 by github-bugzilla — 2015-06-08T16:43:18Z
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
Comment #5 by github-bugzilla — 2015-06-17T21:05:50Z