[DLC] add missing identity checks to 'equals'

^KT-56613
This commit is contained in:
Dmitrii Gridin
2023-02-22 17:15:09 +01:00
committed by Space Team
parent 95455c9870
commit 847b29ac15
2 changed files with 4 additions and 2 deletions
@@ -57,7 +57,8 @@ open class KtLightFieldForDecompiledDeclaration(
override fun computeConstantValue(visitedVars: MutableSet<PsiVariable>?): Any? = (fldDelegate as? PsiVariableEx)?.computeConstantValue(visitedVars)
override fun equals(other: Any?): Boolean = other is KtLightFieldForDecompiledDeclaration &&
override fun equals(other: Any?): Boolean = other === this ||
other is KtLightFieldForDecompiledDeclaration &&
name == other.name &&
fldParent == other.fldParent &&
fldDelegate == other.fldDelegate
@@ -87,7 +87,8 @@ class KtLightMethodForDecompiledDeclaration(
override fun getSignature(substitutor: PsiSubstitutor): MethodSignature =
MethodSignatureBackedByPsiMethod.create(this, substitutor)
override fun equals(other: Any?): Boolean = other is KtLightMethodForDecompiledDeclaration &&
override fun equals(other: Any?): Boolean = other === this ||
other is KtLightMethodForDecompiledDeclaration &&
name == other.name &&
funParent == other.funParent &&
funDelegate == other.funDelegate