more informative error message (IDEA-125544)

This commit is contained in:
Anna Kozlova
2014-08-08 21:14:38 +04:00
parent 8b65338e13
commit 8df64d1cde
3 changed files with 13 additions and 5 deletions

View File

@@ -1229,11 +1229,6 @@ public class HighlightVisitorImpl extends JavaElementVisitor implements Highligh
myHolder.add(HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression)
.descriptionAndTooltip(functionalInterfaceType.getPresentableText() + " is not a functional interface").create());
}
else if (LambdaUtil.dependsOnTypeParams(functionalInterfaceType, functionalInterfaceType, expression)) {
HighlightInfo result1 =
HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(expression).descriptionAndTooltip("Cyclic inference").create();
myHolder.add(result1); //todo[ann] append not inferred type params info
}
}
if (!myHolder.hasErrorResults()) {
final PsiElement referenceNameElement = expression.getReferenceNameElement();

View File

@@ -0,0 +1,9 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
class Main {
public void test() {
Collections.sort(new ArrayList<>(), Comparator::<error descr="Cannot resolve method 'reversed'">reversed</error>);
}
}

View File

@@ -293,6 +293,10 @@ public class NewMethodRefHighlightingTest extends LightDaemonAnalyzerTestCase {
doTest();
}
public void testUnresolvedMethodReference() throws Exception {
doTest();
}
private void doTest() {
doTest(false);
}