Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.5.6
-
None
-
None
-
using groovy via gmaven-runtime-default 1.0-rc-3
Description
I have a constructor:
Foo( String foo, long bar, double... values )
in groovy, i am calling it with a String, a Long, and an Integer.
ParameterTypes.fitToVarArgs correctly determines that the array is a Double.
however, when MetaClassHelper.makeArray is called, it does:
Class baseClass = secondary; if (obj != null) { baseClass = obj.getClass(); }
which overrides the Double.class that is secondary, with Integer.class from the incoming value.
The constructor invocation then fails since the correct type was not passed.