mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
SOE (IDEA-69752 )
This commit is contained in:
@@ -298,7 +298,7 @@ public class PsiSubstitutorImpl implements PsiSubstitutor {
|
||||
PsiType substitutedBoundType = boundType.accept(mySimpleSubstitutionVisitor);
|
||||
PsiWildcardType wildcardType = (PsiWildcardType)substituted;
|
||||
if (substitutedBoundType != null && !(substitutedBoundType instanceof PsiWildcardType) && !substitutedBoundType.equalsToText("java.lang.Object")) {
|
||||
if (originalBound == null || !TypeConversionUtil.erasure(substitutedBoundType).isAssignableFrom(originalBound)) { //erasure is essential to avoid infinite recursion
|
||||
if (originalBound == null || !TypeConversionUtil.erasure(substitutedBoundType).isAssignableFrom(TypeConversionUtil.erasure(originalBound))) { //erasure is essential to avoid infinite recursion
|
||||
if (wildcardType.isExtends()) {
|
||||
final PsiType glb = GenericsUtil.getGreatestLowerBound(wildcardType.getBound(), substitutedBoundType);
|
||||
if (glb != null) {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
public class SOE {
|
||||
}
|
||||
abstract class VersionEntity<V extends Version<V, R>, R extends Ref<V, R>>
|
||||
implements Version<V, R>{}
|
||||
|
||||
interface Version<V extends Version<V, R>, R extends Ref<V, R>>{}
|
||||
|
||||
abstract class RefEntity<V extends Version<V, R>, R extends Ref<V, R>>
|
||||
implements Ref<V, R> {}
|
||||
|
||||
interface Ref<V extends Version<V, R>, R extends Ref<V, R>>{}
|
||||
|
||||
|
||||
abstract class Node<G extends Node<G, GR>,
|
||||
GR extends NodeRef<G, GR>> extends VersionEntity<G, GR> {}
|
||||
|
||||
abstract class NodeRef<G extends Node<G, GR>, GR extends NodeRef<G, GR>> extends RefEntity<G, GR> {}
|
||||
|
||||
|
||||
class D {
|
||||
void f() {
|
||||
Version v = new Node<<error descr="Wildcard type '?' cannot be instantiated directly">?</error>, <error descr="Wildcard type '?' cannot be instantiated directly">?</error>>(){}<EOLError descr="';' expected"></EOLError>
|
||||
}
|
||||
}
|
||||
@@ -81,6 +81,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testIDEADEV24166() throws Exception { doTest(true); }
|
||||
public void testIDEADEV25778() throws Exception { doTest(true); }
|
||||
public void testIDEADEV57343() throws Exception { doTest(false); }
|
||||
public void testSOE() throws Exception { doTest(true); }
|
||||
|
||||
public void testGenericExtendException() throws Exception { doTest(false); }
|
||||
public void testSameErasureDifferentReturnTypes() throws Exception { doTest(false); }
|
||||
|
||||
Reference in New Issue
Block a user