digitalmars.D.learn - overloading
- Ellery Newcomer (1/1) Aug 11 2009 Why is function overloading not applied to nested functions?
- Lars T. Kyllingstad (14/15) Aug 12 2009 Good question. Intuitively it seems to me that they should act just like...
Why is function overloading not applied to nested functions?
Aug 11 2009
Ellery Newcomer wrote:Why is function overloading not applied to nested functions?Good question. Intuitively it seems to me that they should act just like other functions. I couldn't find anything about it in the spec, but I found this (on the "Functions" page): Unlike module level declarations, declarations within function scope are processed in order. This means that two nested functions cannot mutually call each other: void test() { void foo() { bar(); } // error, bar not defined void bar() { foo(); } // ok } Perhaps this also causes problems with overloading? -Lars
Aug 12 2009