at the very least (or until it gets fixed) dmd should emit a more friendly error message:<div>'cannot overload a function in a nested scope'</div><div>otherwise this is hard to understand.<br><br><div class="gmail_quote">
On Wed, May 15, 2013 at 11:43 PM, Jonathan M Davis <span dir="ltr"><<a href="mailto:jmdavisProg@gmx.com" target="_blank">jmdavisProg@gmx.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On Wednesday, May 15, 2013 20:48:19 Steven Schveighoffer wrote:<br>
> On Wed, 15 May 2013 19:10:49 -0400, Timothee Cour<br>
><br>
> <<a href="mailto:thelastmammoth@gmail.com">thelastmammoth@gmail.com</a>> wrote:<br>
> > why isn't this supported?<br>
> ><br>
> >  void main(){<br>
> ><br>
> >     void fun();<br>
> >     void fun(int x);//Error: declaration fun is already defined<br>
> ><br>
> > }<br>
><br>
> Don't know, but it hasn't been supported ever.  Spec clearly states it's<br>
> not supported, but not why.  I suppose it is not difficult to name it<br>
> something else?<br>
><br>
> Note that there are a lot of different rules with nested functions that<br>
> don't apply to normal functions.<br>
<br>
</div></div>You can't have multiple instantiations of templated nested functions either.<br>
IIRC, I created a bug report on it, and Walter closed it as won't fix, but I<br>
don't remember what his reasoning was, though IIRC, he was essentially of the<br>
opinion that nested functions didn't need to have the full capabilities of<br>
normal functions. I assume that that simplifies their implementation, but I<br>
don't know.<br>
<span class="HOEnZb"><font color="#888888"><br>
- Jonathan M Davis<br>
</font></span></blockquote></div><br></div>