paulk-asert opened a new pull request, #2675: URL: https://github.com/apache/groovy/pull/2675
…compilation GROOVY-11182's reproducer (a single byte[] passed to a byte[]... parameter) still failed with IllegalArgumentException when dispatched through MetaMethod#doMethodInvoke — the classic call-site path, and any other route through the reflective MOP invocation. The original fix only added a test; the invokedynamic chain's own varargs adaptation happened to handle the case, masking the gap under the default compilation mode. Root cause: ParameterTypes#fitToVargs treated any trailing array argument as the pre-packed varargs array. Being an array is not sufficient — a byte[] passed to byte[]... is a single element of the byte[][] varargs array. The argument now passes through only when it is assignable to the varargs parameter type or is an array of the same dimension (whose elements the downstream argument coercion converts, e.g. Integer[] for int...); otherwise it is wrapped as an element. Adds a classic-compilation (indy=false) variant of the GROOVY-11182 test. Also reproducible on GROOVY_5_0_X, so a candidate for backport. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
