FIR2IR: fix case with extension called on dynamic

This commit is contained in:
Mikhail Glukhikh
2022-07-19 15:13:35 +02:00
committed by Space
parent 0611f3b8e7
commit 766d873271
@@ -422,7 +422,9 @@ class CallAndReferenceGenerator(
// resolve into members of `Any`.
val convertedExplicitReceiver = if (explicitReceiverExpression?.type is IrDynamicType) {
qualifiedAccess.convertWithOffsets { startOffset, endOffset ->
val targetType = (firSymbol?.fir as? FirCallableDeclaration)?.dispatchReceiverType?.toIrType()
val callableDeclaration = firSymbol?.fir as? FirCallableDeclaration
val targetType = callableDeclaration?.dispatchReceiverType?.toIrType()
?: callableDeclaration?.receiverTypeRef?.toIrType()
?: error("Couldn't get the proper receiver")
IrTypeOperatorCallImpl(
startOffset, endOffset, targetType,