don't make raw type equal to anything else (IDEA-192037)

This commit is contained in:
Anna.Kozlova
2018-05-17 11:19:51 +02:00
parent c4ada244b2
commit 99d01ccd8c
4 changed files with 33 additions and 3 deletions

View File

@@ -115,8 +115,7 @@ public abstract class PsiClassType extends PsiType implements JvmReferenceType {
return aClass == otherClass;
}
return aClass.getManager().areElementsEquivalent(aClass, otherClass) &&
(PsiUtil.isRawSubstitutor(aClass, result.getSubstitutor()) ||
PsiUtil.equalOnEquivalentClasses(this, aClass, otherClassType, otherClass));
PsiUtil.equalOnEquivalentClasses(this, aClass, otherClassType, otherClass);
}
/**

View File

@@ -0,0 +1,7 @@
class Outer<T> {
class Inner { }
Foo<Outer.Inner> m(Foo<Outer<Integer>.Inner> foo) {
<error descr="Incompatible types. Found: 'Foo<Outer<java.lang.Integer>.Inner>', required: 'Foo<Outer.Inner>'">return foo;</error>
}
}
class Foo<X> {}

View File

@@ -0,0 +1,24 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.java.codeInsight.daemon;
import com.intellij.codeInsight.daemon.LightDaemonAnalyzerTestCase;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.testFramework.IdeaTestUtil;
public class GenericsInnerClassHighlightingTest extends LightDaemonAnalyzerTestCase {
private static final String BASE_PATH = "/codeInsight/daemonCodeAnalyzer/genericsInnerClassHighlighting";
public void testGenericToRawAssignment() {
doTest();
}
@Override
protected Sdk getProjectJDK() {
return getTestName(false).contains("Jdk14") ? IdeaTestUtil.getMockJdk14() : super.getProjectJDK();
}
private void doTest() {
doTest(BASE_PATH + "/" + getTestName(false) + ".java", false, false);
}
}

View File

@@ -3,7 +3,7 @@
<VBox xmlns:fx="http://javafx.com/fxml" fx:controller="HighlightRaw">
<TableView fx:id="positive"
onSort="#sortPositive"
onScrollToColumn="#scrollPositive"/>
onScrollToColumn=<warning descr="Incompatible generic parameter of event handler argument: javafx.scene.control.ScrollToEvent<javafx.scene.control.TableColumn> is not assignable from javafx.scene.control.ScrollToEvent<javafx.scene.control.TableColumn>">"#scrollPositive"</warning>/>
<TableView fx:id="negative"
onSort=<warning descr="Incompatible event handler argument: javafx.scene.control.ScrollToEvent is not assignable from javafx.scene.control.SortEvent">"#sortNegative"</warning>
onScrollToColumn=<warning descr="Incompatible generic parameter of event handler argument: javafx.scene.control.ScrollToEvent<javafx.scene.control.TableView> is not assignable from javafx.scene.control.ScrollToEvent<javafx.scene.control.TableColumn>">"#scrollNegative"</warning>