Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
I have the following program
import java.util.function.*; import java.util.Deque; class Main { static final void test(Deque<Integer> p1, Supplier<Integer> p2) { Supplier<Integer> x = (true) ? p1::peek : p2; } }
Actual behavior
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: test.groovy: 8: [Static type checking] - Cannot assign value of type java.lang.Object to variable of type java.util.function.Supplier<java.lang.Integer> @ line 8, column 27. Supplier<Integer> x = (true) ? p1::peek : p2; ^ 1 error
Expected behavior
Compile successfully
Tested against master (commit: ee93378e5c9560032284b66d33af440884c8505f)