From 2306834b06607a32f980b97d69bc68fd47a82ac8 Mon Sep 17 00:00:00 2001 From: Sergey Bogolepov Date: Tue, 18 Jan 2022 12:52:30 +0300 Subject: [PATCH] [K/N] Fix comparison of IrConstantPrimitiveImpl --- .../ir/expressions/impl/IrConstantObjectImpl.kt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrConstantObjectImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrConstantObjectImpl.kt index ba0ee4ef823..9c3c317c6a8 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrConstantObjectImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/expressions/impl/IrConstantObjectImpl.kt @@ -19,12 +19,18 @@ class IrConstantPrimitiveImpl( ) : IrConstantPrimitive() { override fun contentEquals(other: IrConstantValue) = other is IrConstantPrimitive && + type == other.type && value.type == other.value.type && value.kind == other.value.kind && - value.value == other.value + value.value == other.value.value - override fun contentHashCode() = - (value.type.hashCode() * 31 + value.kind.hashCode()) * 31 + value.value.hashCode() + override fun contentHashCode(): Int { + var result = type.hashCode() + result = result * 31 + value.type.hashCode() + result = result * 31 + value.kind.hashCode() + result = result * 31 + value.value.hashCode() + return result + } override var type = value.type }