[Issue 14516] New: Local shadows template parameter
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Apr 27 20:10:19 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14516
Issue ID: 14516
Summary: Local shadows template parameter
Product: D
Version: D2
Hardware: x86
OS: Mac OS X
Status: NEW
Severity: enhancement
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: andrei at erdani.com
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.
--
More information about the Digitalmars-d-bugs
mailing list