From 00fcb6cb021a8e54d75fbb2a99e1303098d46933 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Wed, 13 May 2020 12:17:28 +0300 Subject: [PATCH] [FIR2IR] Minor refactoring of populateOverriddenSymbols --- .../kotlin/fir/backend/Fir2IrDeclarationStorage.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt index 153c55f7afb..b5c53c4914c 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt @@ -933,11 +933,12 @@ class Fir2IrDeclarationStorage( } private fun IrSimpleFunction.populateOverriddenSymbols(thisReceiverOwner: IrClass) { - thisReceiverOwner.findMatchingOverriddenSymbolsFromSupertypes(components.irBuiltIns, this).forEach { - if (it is IrSimpleFunctionSymbol) { - overriddenSymbols += it + thisReceiverOwner.findMatchingOverriddenSymbolsFromSupertypes(components.irBuiltIns, this) + .filterIsInstance().let { + if (it.isNotEmpty()) { + overriddenSymbols = it + } } - } } private fun IrField.populateOverriddenSymbols(thisReceiverOwner: IrClass) {