diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/DataFlowValue.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/DataFlowValue.kt index 74aa99fe02c..ac3c8350d9d 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/DataFlowValue.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/smartcasts/DataFlowValue.kt @@ -90,7 +90,18 @@ class DataFlowValue( override fun toString() = "$kind $identifierInfo $immanentNullability" - override fun hashCode() = type.hashCode() + 31 * identifierInfo.hashCode() + private var hashCode = 0 + + override fun hashCode(): Int { + var hashCode = hashCode + + if (hashCode == 0) { + hashCode = type.hashCode() + 31 * identifierInfo.hashCode() + this.hashCode = hashCode + } + + return hashCode + } companion object {