Bug 7798 – Improve nested functions

Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-03-29T14:16:00Z
Last change time
2015-06-09T05:11:46Z
Keywords
spec
Assigned to
nobody
Creator
siegelords_abode

Comments

Comment #0 by siegelords_abode — 2012-03-29T14:16:04Z
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.
Comment #1 by yebblies — 2012-07-17T10:56:54Z
1. Is issue 3492 2. Is issue 5655 *** This issue has been marked as a duplicate of issue 5655 ***