Re: Local function overloading

2014-04-14 Thread Jonathan M Davis
On Sunday, April 13, 2014 08:40:17 Philpax wrote: Is not being able to overload functions in local scope intended behaviour? Yes. IIRC, I complained about it at one point, and Walter didn't like the idea of having overloaded nested functions. I don't remember what his reasoning was, but I

Re: Local function overloading

2014-04-14 Thread monarch_dodra
On Monday, 14 April 2014 at 10:35:20 UTC, Jonathan M Davis wrote: On Sunday, April 13, 2014 08:40:17 Philpax wrote: Is not being able to overload functions in local scope intended behaviour? Yes. IIRC, I complained about it at one point, and Walter didn't like the idea of having overloaded

Local function overloading

2014-04-13 Thread Philpax
Thanks! I used the static struct solution. I did some quick research, and I think that the reason why the original code doesn't work is because the two functions have the same identifier, which results in Dsymboltable::insert rejecting the second function. I haven't tested this hypothesis,

Local function overloading

2014-04-12 Thread Philpax
While trying to overload a function in local/function scope, I ran into this behaviour: http://dpaste.dzfl.pl/b4e8b9ddf78a and I was wondering what the cause was. As far as I can tell, this should be fine in global scope (and it is), but I'm curious as to why it doesn't work inside a

Re: Local function overloading

2014-04-12 Thread monarch_dodra
On Saturday, 12 April 2014 at 16:45:02 UTC, Philpax wrote: While trying to overload a function in local/function scope, I ran into this behaviour: http://dpaste.dzfl.pl/b4e8b9ddf78a and I was wondering what the cause was. As far as I can tell, this should be fine in global scope (and it is),

Re: Local function overloading

2014-04-12 Thread Andrej Mitrovic
On 4/12/14, monarch_dodra monarchdo...@gmail.com wrote: I know you can workaround it by putting your functions a static members of a dummy struct You can also use a mixin template: class A {} class B {} mixin template M() { void func2(A a) { } void func2(B b) { } } void main() {