Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Consider the following:
void setX(int x) { print x } def map = [:] x = map.x // ParameterTypes#coerceArgumentsToClasses does not deal with null and primitive
The call to setX(int) via property write throws IllegalArgumentException at runtime. The exception message and stack-trace don't provide much context.
java.lang.IllegalArgumentException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at Scratch.run(Scratch.groovy:5)
Attachments
Issue Links
- relates to
-
GROOVY-11371 unsafe conversion of array of reference type to an array of primitive type
-
- Resolved
-