Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.5
-
None
-
None
Description
For this class here:
class Person { String name Person(String name) { this.name = name } }
Attempting to construct an instance but supplying the incorrect type yields expected error messages:
new Person(new Date()) // groovy.lang.GroovyRuntimeException: Could not find matching constructor for: Person(Date) new Person(name: new Date()) // groovy.lang.GroovyRuntimeException: failed to invoke constructor: public Person(java.lang.String) with arguments: [] reason: java.lang.IllegalArgumentException: wrong number of arguments
The second is using normal named args which needs a no-arg constructor.
But when swapping to indy we get:
new Person(new Date()) // groovy.lang.GroovyRuntimeException: Could not find matching constructor for: Person(Date) [Same] new Person(name: new Date()) // java.lang.invoke.WrongMethodTypeException: cannot convert MethodHandle(String)Person to ()Object [Bad Message]