| [#477] | project: compiler | priority: high | category: bug | |
|---|---|---|---|---|
| submitter | assigned to | status | date submitted | |
| Burak | _ | _ | 2005-11-08 21:03:45.0 | |
| subject | useless closures | |||
| code |
object foo {
def nextToken() = {Console.println("tok called")}
def nextToken2 = {Console.println("tok2 called")}
def main(args: Array[String]) = {
nextToken; // creates a closure that is thrown away
nextToken2
}
}
|
|||
| what happened | tok2 called |
|||
| what expected | error, or warning if a closure is created and promoted to a statement. | |||
| [back to overview] | ||||