Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
Description
I have the following program (it uses the apache-commons-lang3 library)
class Main { static final void test() { final byte[] vetting = new byte[1]; final byte[] grafting = org.apache.commons.lang3.ArrayUtils.removeAll(vetting); // works final byte[] grafting = org.apache.commons.lang3.ArrayUtils.removeAll(vetting, 0); // fails } }
Actual behavior
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: groovy38.groovy: 4: [Static type checking] - Reference to method is ambiguous. Cannot choose between [byte[] org.apache.commons.lang3.ArrayUtils#removeAll(byte[], int[]), long[] org.apache.commons.lang3.ArrayUtils#removeAll(long[], int[]), float[] org.apache.commons.lang3.ArrayUtils#removeAll(float[], int[]), double[] org.apache.commons.lang3.ArrayUtils#removeAll(double[], int[]), int[] org.apache.commons.lang3.ArrayUtils#removeAll(int[], int[]), short[] org.apache.commons.lang3.ArrayUtils#removeAll(short[], int[])] @ line 4, column 29. final byte[] grafting = org.apache.commons.lang3.ArrayUtils.removeAll(vetting, 0); ^ 1 error
Expected behavior
Compile successfully
Tested against master (commit: 7a4b2679c77aea8cd9dc00fa2d3b71e25e97fbd2)
Attachments
Issue Links
- is related to
-
GROOVY-10720 Resolving wrong overloaded method?
- Closed