From 851e2dbb6833eb1d11e79dc5a6159dd84a7e9a4b Mon Sep 17 00:00:00 2001 From: "simon.ogorodnik" Date: Wed, 1 Apr 2020 20:42:31 +0300 Subject: [PATCH] [FIR] Implement equals & hashCode for candidates --- .../kotlin/fir/resolve/calls/Candidate.kt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Candidate.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Candidate.kt index 71b5eac12de..f4e4358165a 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Candidate.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Candidate.kt @@ -124,4 +124,19 @@ class Candidate( ExplicitReceiverKind.EXTENSION_RECEIVER, ExplicitReceiverKind.BOTH_RECEIVERS -> callInfo.explicitReceiver!! else -> implicitExtensionReceiverValue?.receiverExpression ?: FirNoReceiverExpression } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (javaClass != other?.javaClass) return false + + other as Candidate + + if (symbol != other.symbol) return false + + return true + } + + override fun hashCode(): Int { + return symbol.hashCode() + } }