| [#410] | project: specification | priority: low | category: missing feature | |
|---|---|---|---|---|
| submitter | assigned to | status | date submitted | |
| Burak | Martin | not repro | 2005-03-29 18:03:08.0 | |
| subject | strange scoping rule | |||
| code |
object forward with Application {
val x = 5;
{ val y = x; // spec says "ambiguous", I can't see why.
val x = 7;
Console.println(y);
}
}
|
|||
| what happened | /tmp> scala -cp . forward 7 |
|||
| what expected | proper lexical scoping for imperative blocks (output 5). | |||
| [back to overview] | ||||
| Burak edited on 2005-03-29 18:03:21.0 |
| Martin edited on 2006-06-28 15:46:48.0 |
| I don;t see how the spec arrives at `ambiguous'. The compiler, in any case says: files/new/bug410.scala:3 error: forward reference extends over definition of value y This is as it should be, IMO |
| Martin edited on 2006-06-28 15:47:11.0 |