Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
May 30, 2016 Why aren't overloaded nested functions allowed? | ||||
---|---|---|---|---|
| ||||
From the spec (https://dlang.org/spec/function.html#nested): "Nested functions cannot be overloaded." Anybody knows what's the rationale? |
May 30, 2016 Re: Why aren't overloaded nested functions allowed? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Max Samukha | 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. |
May 31, 2016 Re: Why aren't overloaded nested functions allowed? | ||||
---|---|---|---|---|
| ||||
Posted in reply to pineapple | On Monday, 30 May 2016 at 23:17:15 UTC, pineapple wrote:
> 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.
Ok, thanks.
|
May 31, 2016 Re: Why aren't overloaded nested functions allowed? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Max Samukha | On 30.05.2016 18:22, Max Samukha wrote: > From the spec (https://dlang.org/spec/function.html#nested): "Nested > functions cannot be overloaded." > > Anybody knows what's the rationale? The rationale is that nobody has implemented it in DMD. https://issues.dlang.org/show_bug.cgi?id=12578 |
May 31, 2016 Re: Why aren't overloaded nested functions allowed? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timon Gehr | On Tuesday, 31 May 2016 at 11:54:40 UTC, Timon Gehr wrote:
> On 30.05.2016 18:22, Max Samukha wrote:
>> From the spec (https://dlang.org/spec/function.html#nested): "Nested
>> functions cannot be overloaded."
>>
>> Anybody knows what's the rationale?
>
> The rationale is that nobody has implemented it in DMD.
> https://issues.dlang.org/show_bug.cgi?id=12578
Ah, that "seems pointless" argument again.
|
Copyright © 1999-2021 by the D Language Foundation