Why aren't overloaded nested functions allowed?
pineapple via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon May 30 16:17:15 PDT 2016
On Monday, 30 May 2016 at 16:22:26 UTC, Max Samukha wrote:
> From the spec (https://dlang.org/spec/function.html#nested):
> "Nested functions cannot be overloaded."
>
> Anybody knows what's the rationale?
I'm guessing it's related to -
> Unlike module level declarations, declarations within function
> scope are processed in order.
And I'd suspect that the cleanest solution would be similar to
the one given for interdependent functions: Declare the nested
functions in a static nested struct instead.
More information about the Digitalmars-d-learn
mailing list