mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
method reference: use site substitutor if nothing else was inferred
This commit is contained in:
@@ -734,6 +734,7 @@ public class InferenceSession {
|
||||
substitutor = substitutor.put(typeParameter, runtimeException);
|
||||
}
|
||||
else {
|
||||
if (substitutor.getSubstitutionMap().get(typeParameter) != null) continue;
|
||||
substitutor = substitutor.put(typeParameter, myErased ? null : getUpperBound(var, substitutor));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
class Base {
|
||||
|
||||
interface Seq<Eq> extends Iterable<Eq> {
|
||||
static <E> Seq<E> of(Iterable<? extends E> source) {
|
||||
return null;
|
||||
}
|
||||
|
||||
<R> Seq<R> map(Function<? super Eq, ? extends R> mapper);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class Test3 extends Base {
|
||||
|
||||
void test4(Seq<List<String>> map) {
|
||||
Seq<Seq<String>> mapped = map.map(Seq::of);
|
||||
}
|
||||
}
|
||||
@@ -213,6 +213,10 @@ public class NewMethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIDEA122018comment() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user