Mantis - Squeak
Viewing Issue Advanced Details
4309 Compiler minor always 07-21-06 16:57 05-12-14 22:19
nicolas cellier  
resolved 3.9  
none trunk  
0004309: Compiler/Parser allows undefined variable when LHS to :=
The following snippet does NOT raise an error message:

 | tmp1 tmp2 |
  tmp1 := 2.
  tmp2 := tmp2 + tmp1

But the following modification DOES raise an "undefined. proceed?" dialog

 | tmp1 tmp2 |
  tmp1 := 2.
  tmp1 := tmp2 + tmp1

Tested with 3.8 + 3.9.

Note that the error message should speak about "uninitialized" instead of "undefined" because the variables are indeed between the |'s.
There can only be ONE rule for what is uninitialized and what is initialized, regardless of how a variable is used "mentioned" for the first time on the RHS of an expression.

nicolas cellier   
05-12-14 22:19   
This is no more true in Squeak 4.5, and probably has been fixed for a long time now (Eliot's closure?)