From fe4595889c800d43fd2d8a76c066a3525c7de1a2 Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Wed, 8 Feb 2017 19:59:04 +0100 Subject: [PATCH] inference: don't merge inference variables based on same type parameter EA-82843 - IAE: TObjectHash.throwObjectContractViolation --- .../source/resolve/graphInference/InferenceVariable.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceVariable.java b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceVariable.java index 78949153555b..0e3661a03b0b 100644 --- a/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceVariable.java +++ b/java/java-psi-impl/src/com/intellij/psi/impl/source/resolve/graphInference/InferenceVariable.java @@ -18,7 +18,6 @@ package com.intellij.psi.impl.source.resolve.graphInference; import com.intellij.psi.*; import com.intellij.psi.augment.TypeAnnotationModifier; import com.intellij.psi.impl.light.LightTypeParameter; -import com.intellij.psi.util.PsiTreeUtil; import com.intellij.psi.util.PsiUtil; import com.intellij.psi.util.TypeConversionUtil; import org.jetbrains.annotations.NotNull; @@ -192,12 +191,7 @@ public class InferenceVariable extends LightTypeParameter { @Override public boolean isEquivalentTo(PsiElement another) { - if (this == another) return true; - - if (getDelegate() == another && myContext != null && !PsiTreeUtil.isAncestor(((PsiTypeParameter)another).getOwner(), myContext, false)) { - return true; - } - return false; + return this == another; } @Override