DMD can implicitly convert class pointer to the bool. Is it bug or terrible feature?

Walter Bright newshound2 at digitalmars.com
Sun Nov 24 11:59:53 PST 2013


On 11/24/2013 11:17 AM, bearophile wrote:
> Walter Bright:
>
>> Shadowing globals is definitely a bad idea. Shadowing members, it's debatable.
>
> So are you saying D here should give an error for the shadowing of the
> module-level x?
>
>
> struct Foo { int x; }
> int x;
> void main() {
>      Foo f;
>      with (f) {
>          x++;
>      }
> }

I meant "bad" as in bad, not as in "good" :-)


>  From my experience that's quite bug-prone:
> http://d.puremagic.com/issues/show_bug.cgi?id=3878

I posted an objection there :-)


More information about the Digitalmars-d mailing list