[FIR2IR] Use deepest matching symbol also for synthetic properties

#KT-42359 Fixed
This commit is contained in:
Mikhail Glukhikh
2020-10-06 13:27:30 +03:00
parent fb4f27e136
commit aa4a042612
3 changed files with 83 additions and 4 deletions
@@ -143,11 +143,12 @@ private fun FirCallableSymbol<*>.toSymbol(declarationStorage: Fir2IrDeclarationS
is FirFunctionSymbol<*> -> declarationStorage.getIrFunctionSymbol(this)
is SyntheticPropertySymbol -> {
(fir as? FirSyntheticProperty)?.let { syntheticProperty ->
if (preferGetter) {
syntheticProperty.getter.delegate.symbol.toSymbol(declarationStorage, preferGetter)
val delegateSymbol = if (preferGetter) {
syntheticProperty.getter.delegate.symbol
} else {
syntheticProperty.setter!!.delegate.symbol.toSymbol(declarationStorage, preferGetter)
syntheticProperty.setter!!.delegate.symbol
}
delegateSymbol.deepestMatchingOverriddenSymbol().toSymbol(declarationStorage, preferGetter)
} ?: declarationStorage.getIrPropertySymbol(this)
}
is FirPropertySymbol -> declarationStorage.getIrPropertySymbol(this)