Fantom

Login | Register

Report variable names which conflict with imported types #1297

jodastephen
8 Nov 2010

The compiler allows local variables with type names:

Str str := "j"  // compiles, valid
str := "j"      // compiles, valid
Str := "j"      // does not compile, valid
Str Str := "j"  // compiles, bug

When defined this way, the variable named Str cannot be used. eg this fails to compile:

echo(Str)

The same problem affects parameters.

brian
8 Nov 2010

Promoted to ticket #1297 and assigned to brian

Thanks for reporting

brian
8 Nov 2010

Renamed from Variable identifier bug to Report variable names which conflict with imported types

brian
8 Nov 2010

Ticket resolved in 1.0.56

This situation will now report a compiler error

Login or Register to Reply

Back | All Topics