Fix hashCode & equals for IntegerValueTypeConstant

This commit is contained in:
Mikhail Zarechenskiy
2018-08-08 14:36:20 +03:00
parent 1a511166cc
commit 70aa16f71a
@@ -42,7 +42,7 @@ interface CompileTimeConstant<out T> {
val isUnsignedNumberLiteral: Boolean get() = parameters.isUnsignedNumberLiteral
class Parameters(
data class Parameters(
val canBeUsedInAnnotation: Boolean,
val isPure: Boolean,
// `isUnsignedNumberLiteral` means that this constant represents simple number literal with `u` suffix (123u, 0xFEu)
@@ -172,7 +172,8 @@ class IntegerValueTypeConstant(
override fun toString() = typeConstructor.toString()
override fun equals(other: Any?) = other is IntegerValueTypeConstant && value == other.value
override fun equals(other: Any?) = other is IntegerValueTypeConstant && value == other.value && parameters == other.parameters
override fun hashCode() = 31 * value.hashCode() + parameters.hashCode()
override fun hashCode() = value.hashCode()
}