testdata for IDEA-81318
authorAnna Kozlova <anna.kozlova@jetbrains.com>
Thu, 3 Sep 2015 17:12:32 +0000 (20:12 +0300)
committerAnna Kozlova <anna.kozlova@jetbrains.com>
Thu, 3 Sep 2015 17:31:05 +0000 (20:31 +0300)
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA81318.java [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/codeInsight/daemon/GenericsHighlightingTest.java

diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA81318.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/genericsHighlighting/IDEA81318.java
new file mode 100644 (file)
index 0000000..4463d2b
--- /dev/null
@@ -0,0 +1,15 @@
+
+import java.util.List;
+import java.util.Map;
+
+class Test {
+  public static<F, S> void xyz() {
+    class Pair<X, Y> {}
+    class Role<F> {}
+
+    Map<?, List<Pair<?, ?>>> map = null;
+    Role<F> role = null;
+
+    List<Pair<F, S>> result = <error descr="Inconvertible types; cannot cast 'java.util.List<Pair<?,?>>' to 'java.util.List<Pair<F,S>>'">(List<Pair<F, S>>) map.get(role)</error>;
+  }
+}
\ No newline at end of file
index 57df3ebac953e18c3ce60a717c916884bc5e3b1b..a620c792dd7414e12b6f4219c2ea824bec84ef97 100644 (file)
@@ -520,6 +520,10 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
     doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false);
   }
 
+  public void testIDEA81318() throws Exception {
+    doTest(LanguageLevel.JDK_1_7, JavaSdkVersion.JDK_1_7, false);
+  }
+
   public void testJavaUtilCollections_NoVerify() throws Exception {
     PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));
     assertNotNull(collectionsClass);