mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 05:21:29 +07:00
method ref: ensure capture conversion on first arg of second search
This commit is contained in:
@@ -1627,7 +1627,8 @@ public class InferenceSession {
|
||||
|
||||
final PsiType qType = JavaPsiFacade.getElementFactory(method.getProject()).createType(containingClass, psiSubstitutor);
|
||||
|
||||
addConstraint(new TypeCompatibilityConstraint(substituteWithInferenceVariables(qType), pType));
|
||||
addConstraint(new TypeCompatibilityConstraint(substituteWithInferenceVariables(qType),
|
||||
PsiUtil.captureToplevelWildcards(pType, reference)));
|
||||
|
||||
if (methodContainingClass != null) {
|
||||
psiSubstitutor = JavaClassSupers.getInstance().getSuperClassSubstitutor(methodContainingClass, containingClass, reference.getResolveScope(), psiSubstitutor);
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
class MyTest {
|
||||
{
|
||||
Appender data = Map::appendData;
|
||||
}
|
||||
}
|
||||
|
||||
interface Map<B> {
|
||||
void appendData(String appender) ;
|
||||
}
|
||||
|
||||
interface Appender {
|
||||
void append(Map<?> map, String appender);
|
||||
}
|
||||
@@ -184,6 +184,7 @@ public class NewMethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
|
||||
public void testPreferErrorOnTopLevelToFailedSubstitutorOnNestedLevel() { doTest(); }
|
||||
public void testDontIgnoreIncompatibilitiesDuringFirstApplicabilityCheck() { doTest(); }
|
||||
public void testCaptureOnDedicatedParameterOfSecondSearch() { doTest(); }
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
|
||||
Reference in New Issue
Block a user