[FIR2IR] Don't access symbol.owner in DataClassMembersGenerator

This commit is contained in:
Dmitriy Novozhilov
2023-11-27 14:09:49 +02:00
committed by Space Team
parent 50f1ea79c5
commit da531bc261
2 changed files with 16 additions and 6 deletions
@@ -240,7 +240,7 @@ abstract class DataClassMembersGenerator(
protected fun IrBuilderWithScope.getHashCodeOf(hashCodeFunctionInfo: HashCodeFunctionInfo, irValue: IrExpression): IrExpression {
val hashCodeFunctionSymbol = hashCodeFunctionInfo.symbol
val hasDispatchReceiver = hashCodeFunctionSymbol.hasDispatchReceiver()
val hasDispatchReceiver = hashCodeFunctionInfo.hasDispatchReceiver ?: hashCodeFunctionSymbol.hasDispatchReceiver()
return irCall(
hashCodeFunctionSymbol,
context.irBuiltIns.intType,
@@ -263,6 +263,13 @@ abstract class DataClassMembersGenerator(
interface HashCodeFunctionInfo {
val symbol: IrSimpleFunctionSymbol
/**
* Implement it if [symbol] may be unbound
*/
val hasDispatchReceiver: Boolean?
get() = null
fun commitSubstituted(irMemberAccessExpression: IrMemberAccessExpression<*>)
}