Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
This is probably a regression
I have the following program
import java.util.function.*; class Main { static final void test() { final Function<Double, Double> x = Main::clone; } public static <T> T clone(T x) { return x; } }
Actual behavior
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: test.groovy: 5: [Static type checking] - Invalid return type: java.lang.Object is not convertible to java.lang.Double @ line 5, column 40. final Function<Double, Double> x = Main::clone; ^ 1 error
Expected behavior
Compile successfully
Notes
Tested against master (commit: c4ee3ce0661eec7d633fc81281d79c8889b3dc66)
Test case adapted from:
import java.util.function.*; class Main { static final void test() { Function<Double, Double> x = org.apache.commons.lang3.ObjectUtils::clone; } }