Wouldn't the compiler be smart with this shadowing variable?

Matheus matheus at gmail.com
Sat Dec 11 15:15:06 UTC 2021


On Saturday, 11 December 2021 at 01:02:36 UTC, frame wrote:
> ...
> You probably want this:
>
> ```d
> int j;
> for({int i=0; j=0;} i<10; ++i){}
> ```
>
> Beware, this syntax comes directly from hell

Well this works! :)

I'm just a bit intrigued by your last sentence. Is there anything 
evil this may result or anything that I should be aware of?

Matheus.


More information about the Digitalmars-d-learn mailing list