Compiler bug ?
Jonathan M Davis
jmdavisProg at gmx.com
Fri May 17 10:08:19 PDT 2013
On Friday, May 17, 2013 11:59:38 1100110 wrote:
> On 05/17/2013 09:35 AM, Maxim Fomin wrote:
> > If it alwalys a bad idea, compiler should not accept such code.
>
> It is not the D way to forbid you from shooting yourself in the foot.
>
> goto, catch(Throwable th), there are plenty more examples.
D will stop you from shooting yourself in the foot if it can do so in a way
that doesn't actually limit you, and it does do quite a few things to make it
harder to shoot yourself in the foot, but it certainly doesn't ultimately stop
you from doing so. However, if it _never_ makes sense to declare a variable
beginning with two underscores, I don't know why the compiler wouldn't forbid
it other than the fact that it probably inserts such variables prior to when
it would do the semantic analysis to check whether variables started with
underscores, in which case, catching the user's variables that start with two
underscores while permitting the compiler's variables could get tricky.
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list