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: [email protected]
Reporter: [email protected]
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.
--