August 12, 2009
Why is function overloading not applied to nested functions?
August 12, 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