Bug 14516 – Local shadows template parameter

Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-04-28T03:10:19Z
Last change time
2023-12-16T18:23:53Z
Assigned to
No Owner
Creator
Andrei Alexandrescu

Comments

Comment #0 by andrei — 2015-04-28T03:10:19Z
Just caught a bug in some code: auto fun(string f = __FUNCTION__)() { string f = "abc"; return f; } void main() { assert(fun() == "abc"); // passes } In the spirit of avoidance of all hijacking/shadowing, this should probably be an error.
Comment #1 by b2.temp — 2023-12-16T18:23:53Z
*** This issue has been marked as a duplicate of issue 6980 ***