Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.5.7
-
None
-
None
-
XP, cygwin, JRE 1.6.0
Description
A call method on an enum can be used within a for loop, but not otherwise. This is kind of odd, and it might be better to disable the for loop behavior if it's not reasonable to fix in general.
enum Foo { A({ println("A") }), B({ println("B") }) Foo(Closure c) { call = c } final Closure call } // works for (f in Foo) { f() } // works Foo.A.call() // doesn't work Foo.A() // doesn't work a=Foo.A a()