for loop

Mantis mail.mantis.88 at gmail.com
Mon Jan 23 10:27:53 PST 2012


23.01.2012 20:06, bearophile пишет:
> Ellery Newcomer:
>
>> void main(){
>>           for ({int x=0; short y=0;} x<  10; x++, y++){
>>           }
>> }
> I don't understand, is that a compiler bug?
> Aren't x and y in a sub-scope that ends before you use x and y?
>
> Bye,
> bearophile
>
According to specs, this is BlockStatement that doesn't create scope, if 
I don't miss anything.


More information about the Digitalmars-d-learn mailing list