August 12, 2009 overloading | ||||
---|---|---|---|---|
| ||||
Why is function overloading not applied to nested functions? |
August 12, 2009 Re: overloading | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ellery Newcomer | 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
|
Copyright © 1999-2021 by the D Language Foundation