Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#44 variables scope fails

compiler
closed-fixed
John Hansen
NBC (24)
5
2009-01-18
2007-10-23
Anonymous
No

Hi,

I've found a (I think) bug in the treatment of scope. The thing is that, when yo do something like that:

task main(){

for (int i=0; i<2; i++){
/* do something */
}

for (int i=0; i<3; i++){
/* THIS CRASHES */
}
}

it crashes in the second for, saying that 'i' is an used identifier:

Error: Duplicate Identifier __main__7qG2__i__7qG2__001

Something like that happens when declaring a variable on a new compound statement when it was declared another one before:

task main() {
{
string w;
}

{
string w; // This fails;
}

string w;
}

It considers the opening of new brackets as if it were opening the old one.

Sorry for my awful english... :-(

Best regards.

Discussion

  • John Hansen
    John Hansen
    2009-01-18

    This is fixed in the current release.

     
  • John Hansen
    John Hansen
    2009-01-18

    • status: open --> closed-fixed