StrangeNoises opened a new pull request #1591: URL: https://github.com/apache/groovy/pull/1591
Fix ambiguous behaviour when varargs methods are called with a single varargs argument, which may evaluate to null. Do it while compiling, when we can (often) tell if a given argument expression will be an array or not, and if clearly not, wrap it in an array. Do nothing for `@CompileStatic`, which already exhibits consistent behaviour; this makes `@CompileDynamic` behaviour consistent with `@CompileStatic` in conditions where the argument type can be known. And if all else fails (the argument expression is irretrievably dynamic so we couldn't help), the Groovy coder can now force the behaviour they expected with a cast-or-coerce. (It wouldn't have helped before.) The only existing tests that have been changed are those that call a varargs method with a single null constant, as that behaviour is now changed to accept that as a null object, in line with `@CompileStatic` behaviour. Many new test lines have been added to VarargsMethodTest to pick through the various situations that can arise. -- 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. For queries about this service, please contact Infrastructure at: [email protected]
