Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.5.7
-
Fix Version/s: 1.6.1, 1.5.8, 1.7-beta-1
-
Component/s: None
-
Labels:None
-
Environment:XP, cygwin, JRE 1.6.0
-
Number of attachments :
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()
Activity
Roshan Dawrani
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Roshan Dawrani [ roshandawrani ] |
Roshan Dawrani
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Fix Version/s | 1.6.1 [ 14852 ] | |
| Resolution | Fixed [ 1 ] | |
| Fix Version/s | 1.5.8 [ 14630 ] | |
| Fix Version/s | 1.7-beta-1 [ 14014 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |