IR: add type parameter to IrMemberAccessExpression and some subclasses
This is needed to get rid of the diamond hierarchy:
IrMemberAccessExpression
/ \
/ \
IrFunctionAccessExpression IrCallableReference
\ /
\ /
IrFunctionReference
In the subsequent commit, IrFunctionReference no longer inherits from
IrFunctionAccessExpression; the more precise type of `val symbol:
IrFunctionSymbol` is now carried via the generic type argument.
This will help to refactor IR element hierarchy from interfaces to
classes, improving performance of visitors and transformers.
This commit is contained in:
+1
-1
@@ -331,7 +331,7 @@ abstract class IrFileDeserializer(
|
||||
return IrBlockImpl(start, end, type, origin, statements)
|
||||
}
|
||||
|
||||
private fun deserializeMemberAccessCommon(access: IrMemberAccessExpression, proto: ProtoMemberAccessCommon) {
|
||||
private fun deserializeMemberAccessCommon(access: IrMemberAccessExpression<*>, proto: ProtoMemberAccessCommon) {
|
||||
|
||||
proto.valueArgumentList.mapIndexed { i, arg ->
|
||||
if (arg.hasExpression()) {
|
||||
|
||||
+1
-1
@@ -472,7 +472,7 @@ open class IrFileSerializer(
|
||||
return proto.build()
|
||||
}
|
||||
|
||||
private fun serializeMemberAccessCommon(call: IrMemberAccessExpression): ProtoMemberAccessCommon {
|
||||
private fun serializeMemberAccessCommon(call: IrMemberAccessExpression<*>): ProtoMemberAccessCommon {
|
||||
val proto = ProtoMemberAccessCommon.newBuilder()
|
||||
if (call.extensionReceiver != null) {
|
||||
proto.extensionReceiver = serializeExpression(call.extensionReceiver!!)
|
||||
|
||||
Reference in New Issue
Block a user