Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.5.6
-
Fix Version/s: 1.6-rc-1, 1.5.8, 1.7-beta-1
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
This one
enum MyEnum { ONE ([1,2]), TWO ([3,4]); private final List myList MyEnum (List myList) { this.myList=myList } } MyEnum.ONE
leads to "groovy.lang.GroovyRuntimeException: Could not find matching constructor for: MyEnum(java.lang.String, java.lang.Integer, java.lang.Integer, java.lang.Integer)"
Adding "as List" to the List declaration works:
enum MyEnum { ONE ([1,2] as List), TWO ([3,4] as List); private final List myList MyEnum (List myList) { this.myList=myList } } MyEnum.ONE
Why isn't "[x,y,z]" interpreted as a List in construction of enum instances?
Bug or a feature? ![]()
-----------
blackdrag: "looks like a bug for me.. please fill a report in JIRA"