[FIR2IR] Create fake one-time use properties for callable reference to synthetic properies

Previously fir2ir created real IR properties some getter and setter for
  such references, which lead to the situation that there might be a
  unbound fake override for synthetic property which wasn't stored in
  declaration storage (and code in FakeOverrideGenerator was a hack
  to cover this case)
In the same time K1 creates fake property for such cases, which is stored
  in IrPropertyReference along with original get... and set... functions
  as getter and setter of reference. And in this commit K2 does the same thing

^KT-61637
This commit is contained in:
Dmitriy Novozhilov
2023-09-01 12:32:17 +03:00
committed by Space Team
parent 7ea54ee87f
commit 36cb869ac2
6 changed files with 173 additions and 116 deletions
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.fir.symbols.impl
import org.jetbrains.kotlin.fir.FirLabel
import org.jetbrains.kotlin.fir.contracts.FirResolvedContractDescription
import org.jetbrains.kotlin.fir.declarations.*
import org.jetbrains.kotlin.fir.declarations.synthetic.FirSyntheticProperty
import org.jetbrains.kotlin.fir.expressions.FirDelegatedConstructorCall
import org.jetbrains.kotlin.fir.references.FirControlFlowGraphReference
import org.jetbrains.kotlin.fir.references.toResolvedConstructorSymbol
@@ -81,6 +82,9 @@ class FirConstructorSymbol(callableId: CallableId) : FirFunctionSymbol<FirConstr
*/
abstract class FirSyntheticPropertySymbol(propertyId: CallableId, val getterId: CallableId) : FirPropertySymbol(propertyId) {
abstract fun copy(): FirSyntheticPropertySymbol
val syntheticProperty: FirSyntheticProperty
get() = fir as FirSyntheticProperty
}
// ------------------------ unnamed ------------------------