http://d.puremagic.com/issues/show_bug.cgi?id=7798
Summary: Improve nested functions
Product: D
Version: D1 & D2
Platform: All
OS/Version: All
Status: NEW
Keywords: spec
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from [email protected] 2012-03-29 14:16:04 PDT ---
I've run into two issues with nested functions that I think should be fixed. As
is, it seems that the nested functions are scarcely more than syntax sugar for
delegates.
1. Overloading:
void main()
{
void test() {}
void test(int a) {}
}
No good reason why that shouldn't work. This is described in the spec, but no
good reason is given.
2. Reusing same function name in different scopes:
void main()
{
{ void test() {} }
{ void test() {} }
}
This won't compile either. This limitation isn't even described in the spec as
far as I can tell.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------