Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
I have the following program
import java.util.function.Supplier; class Main { static final void test() { Main.<String>m(() -> "df", "fdaf"); } static <T> void m(Supplier<T> x, T... y) {} static <T extends Comparable<? extends T>> void m(T...y) {} }
Actual behavior
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: test.groovy: 5: [Static type checking] - Cannot return value of type java.lang.String for lambda expecting int @ line 5, column 26. Main.<String>m(() -> "df", "fdaf"); ^ 1 error
Expected behavior
Compile successfully
Notes
Tested against master (commit: a4e0d6de9cc2d8ecb48b48df501e63ec1735d837)
Test case adapted from:
class Main { static final void test() { org.apache.commons.lang3.ObjectUtils.<String>median((stills, impeaches) -> 86 , "fdaf"); } }
Attachments
Issue Links
- relates to
-
GROOVY-11094 SAM types not working well along with overloading
- Closed