mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
method ref: ensure top substitutor is not overridden with raw replacement from second method ref search (IDEA-158636)
This commit is contained in:
+1
-1
@@ -1599,7 +1599,7 @@ public class InferenceSession {
|
||||
return receiverSubstitutor;
|
||||
}
|
||||
}
|
||||
mySiteSubstitutor = receiverSubstitutor;
|
||||
mySiteSubstitutor = mySiteSubstitutor.putAll(receiverSubstitutor);
|
||||
|
||||
if (methodContainingClass != null) {
|
||||
final PsiSubstitutor superSubstitutor = TypeConversionUtil.getClassSubstitutor(methodContainingClass, containingClass, receiverSubstitutor);
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package pi;
|
||||
|
||||
import java.util.stream.Stream;
|
||||
|
||||
abstract class Foo<T> {
|
||||
public abstract <X> Foo<X> getAssociatedFoo();
|
||||
|
||||
public abstract static class Bar<Z> {
|
||||
public Stream<Foo<Object>> getAssociatedFoos(Stream<Foo<Z>> stream) {
|
||||
return stream.map(Foo::getAssociatedFoo);
|
||||
}
|
||||
}
|
||||
}
|
||||
+4
@@ -518,6 +518,10 @@ public class NewMethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testMethodReferenceSecondSearchDontInfluenceTopSiteSubstitutor() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user