Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
This is probably a regresssion.
I have the following program
import java.util.*; import java.util.concurrent.*; class Foo<K, V> { V apply(K p) { return null; } } class Main { static final void test(Foo<Map.Entry<Number, Boolean>, String> p) { ConcurrentHashMap.KeySetView<Number, Boolean> x = null; ConcurrentHashMap<Number, Boolean> y = x.getMap(); y.<String>reduceEntries(19, p::apply, null); // works x.getMap().<String>reduceEntries(19, p::apply, null); // fails } }
Actual behavior
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Main.groovy: 15: Failed to find method 'apply(java.util.Map$Entry<java.lang.Object, java.lang.Object>)' for the type: Foo<java.util.Map$Entry<java.lang.Number, java.lang.Boolean>, java.lang.String> @ line 15, column 42. p().<String>reduceEntries(19, p::apply, ^ 1 error
Expected behavior
Compile successfully
Notes
Tested against master