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:
+2
-2
@@ -71,7 +71,7 @@ interface IrBuilderExtension {
|
||||
callee: IrFunctionSymbol,
|
||||
vararg args: IrExpression,
|
||||
typeHint: IrType? = null
|
||||
): IrMemberAccessExpression {
|
||||
): IrMemberAccessExpression<*> {
|
||||
assert(callee.isBound) { "Symbol $callee expected to be bound" }
|
||||
val returnType = typeHint ?: callee.run { owner.returnType }
|
||||
val call = irCall(callee, type = returnType)
|
||||
@@ -86,7 +86,7 @@ interface IrBuilderExtension {
|
||||
typeArguments: List<IrType?>,
|
||||
valueArguments: List<IrExpression>,
|
||||
returnTypeHint: IrType? = null
|
||||
): IrMemberAccessExpression =
|
||||
): IrMemberAccessExpression<*> =
|
||||
irInvoke(
|
||||
dispatchReceiver,
|
||||
callee,
|
||||
|
||||
Reference in New Issue
Block a user