inference: skip lambda content and all its dependants when lambda type parameter type is calculated

This commit is contained in:
Anna Kozlova
2016-03-03 11:39:53 +01:00
parent 953c6249c4
commit 1e764c9961
16 changed files with 167 additions and 72 deletions
@@ -20,6 +20,7 @@ import com.intellij.codeInsight.daemon.impl.HighlightInfo;
import com.intellij.lang.annotation.HighlightSeverity;
import com.intellij.openapi.projectRoots.JavaSdkVersion;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.testFramework.IdeaTestUtil;
import org.jetbrains.annotations.NonNls;
@@ -419,18 +420,17 @@ public class GraphInferenceHighlightingTest extends LightDaemonAnalyzerTestCase
}
}
assertTrue(tooltips.contains("<html><body><table border=0><tr><td>" +
"<b>identity(&nbsp;)&nbsp;</b></td><td colspan=1>in <b>Function</b>&nbsp;cannot be applied</td></tr><tr><td>to</td><td><b>()</b>&nbsp;" +
"</td></tr></table><br/>" +
"reason: no instance(s) of type variable(s) K, U exist so that Map&lt;K, U&gt; conforms to Function&lt;U, V&gt;" +
"</body></html>"));
assertTrue(tooltips.contains(
"<html><body><table border=0><tr><td>" +
"<b>identity(&nbsp;)&nbsp;</b></td><td colspan=1>in <b>Function</b>&nbsp;cannot be applied</td></tr><tr><td>to</td><td><b>()</b>&nbsp;" +
"</td></tr></table><br/>" +
"reason: no instance(s) of type variable(s) K, U exist so that Map&lt;K, U&gt; conforms to Function&lt;U, V&gt;" +
"</body></html>"));
boolean found = false;
for (String tooltip : tooltips) {
if (tooltip.contains("reason: no instance(s) of type variable(s) K, U exist so that Map&lt;K, U&gt; conforms to Function&lt;U, V&gt;")) {
found = true;
break;
}
}
if (!found) {
fail(StringUtil.join(tooltips, ", "));
}
}
private void doTest() throws Exception {
@@ -63,6 +63,14 @@ public class Java8ExpressionsCheckTest extends LightDaemonAnalyzerTestCase {
doTestCachedUnresolved();
}
public void testCacheUnresolvedMethods4() throws Exception {
doTestCachedUnresolved();
}
public void testCacheUnresolvedMethods5() throws Exception {
doTestCachedUnresolved();
}
public void testMethodOverloadsInsideLambdaHierarchy() throws Exception {
doTestAllMethodCallExpressions();
}