Perhaps the error message could be improved, but the spec mentions that this
code isn't allowed:
"Unlike module level declarations, declarations within function scope are
processed in order. This means that two nested functions cannot mutually call
each other." (http://www.digitalmars.com/d/function.html)
Hopefully someday we'll be able to use nested functions before they are defined,
but at least this limitation is mentioned in the spec.
jcc7

Perhaps the error message could be improved, but the spec mentions that this
code isn't allowed:
"Unlike module level declarations, declarations within function scope are
processed in order. This means that two nested functions cannot mutually call
each other." (http://www.digitalmars.com/d/function.html)
Hopefully someday we'll be able to use nested functions before they are
defined,
but at least this limitation is mentioned in the spec.

Hmmm. Didn't notice that. Well, I guess that it's fair if it's
documented :/
I am very curious though, Walter, what the reason for this is. Just
speaking as a programmer, I'd be fascinated to understand why this
requirement exists. It would seem (from the outside) that whatever code
you use use handle forward references in general could be leveraged to
also handle this case.

I am very curious though, Walter, what the reason for this is. Just
speaking as a programmer, I'd be fascinated to understand why this
requirement exists. It would seem (from the outside) that whatever code
you use use handle forward references in general could be leveraged to
also handle this case.

To fix it, the semantic pass for function bodies would have to be rewritten
to be multipass, and it seems a low priority to do that.