Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.5.6
-
None
-
None
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"