mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
method refs: missed qualifier substitution for return type (IDEA-140539)
This commit is contained in:
+1
-1
@@ -184,7 +184,7 @@ public class PsiMethodReferenceCompatibilityConstraint implements ConstraintForm
|
||||
//the constraint reduces to the bound set B3 which would be used to determine the method reference's invocation type
|
||||
//when targeting the return type of the function type, as defined in 18.5.2.
|
||||
session.collectApplicabilityConstraints(myExpression, ((MethodCandidateInfo)resolve), groundTargetType);
|
||||
session.registerReturnTypeConstraints(referencedMethodReturnType, returnType);
|
||||
session.registerReturnTypeConstraints(psiSubstitutor.substitute(referencedMethodReturnType), returnType);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import java.util.function.Function;
|
||||
|
||||
class Test {
|
||||
|
||||
private void foo(final Function<String, String> steps) {
|
||||
map(steps::compose);
|
||||
}
|
||||
|
||||
<U> void map(Function<Function<String, String>, U> mapper) {}
|
||||
}
|
||||
+4
@@ -402,6 +402,10 @@ public class NewMethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSubstitutionForReturnTypeConstraintsForTargetGenericMethod() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user