mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -111,7 +111,7 @@ public class MethodCandidateInfo extends CandidateInfo{
|
||||
public int getPertinentApplicabilityLevel() {
|
||||
if (myPertinentApplicabilityLevel == 0) {
|
||||
myPertinentApplicabilityLevel = getPertinentApplicabilityLevelInner();
|
||||
pullInferenceErrorMessagesFromSubexpressions();
|
||||
myPertinentApplicabilityLevel = pullInferenceErrorMessagesFromSubexpressions();
|
||||
}
|
||||
return myPertinentApplicabilityLevel;
|
||||
}
|
||||
@@ -474,8 +474,9 @@ public class MethodCandidateInfo extends CandidateInfo{
|
||||
return errorMessage;
|
||||
}
|
||||
|
||||
private void pullInferenceErrorMessagesFromSubexpressions() {
|
||||
if (myPertinentApplicabilityLevel == ApplicabilityLevel.NOT_APPLICABLE && myArgumentList instanceof PsiExpressionList) {
|
||||
private int pullInferenceErrorMessagesFromSubexpressions() {
|
||||
if (myArgumentList instanceof PsiExpressionList &&
|
||||
(myPertinentApplicabilityLevel == ApplicabilityLevel.NOT_APPLICABLE || !isToInferApplicability())) {
|
||||
String errorMessage = null;
|
||||
for (PsiExpression expression : ((PsiExpressionList)myArgumentList).getExpressions()) {
|
||||
final String message = clearErrorMessageInSubexpressions(expression);
|
||||
@@ -485,8 +486,10 @@ public class MethodCandidateInfo extends CandidateInfo{
|
||||
}
|
||||
if (errorMessage != null) {
|
||||
setInferenceError(errorMessage);
|
||||
return ApplicabilityLevel.NOT_APPLICABLE;
|
||||
}
|
||||
}
|
||||
return myPertinentApplicabilityLevel;
|
||||
}
|
||||
|
||||
private static String clearErrorMessageInSubexpressions(PsiExpression expression) {
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
|
||||
class A<T> {}
|
||||
class B<K> extends A<String> {}
|
||||
|
||||
class X<L> {
|
||||
public X(A<L> b1) {
|
||||
this(new B<>());
|
||||
}
|
||||
|
||||
public X(B<L> b2) {}
|
||||
}
|
||||
+4
@@ -81,6 +81,10 @@ public class Diamond8HighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testDiamondInsideOverloadedThisReference() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
doTest(BASE_PATH + "/" + getTestName(false) + ".java", false, false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user