You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -3409,8 +3423,7 @@ open class KotlinFileExtractor(
3409
3423
expressionTypeArgs:List<IrType>, // type arguments of the extracted expression
3410
3424
classTypeArgsIncludingOuterClasses:List<IrTypeArgument>?, // type arguments of the class containing the callable reference
3411
3425
dispatchReceiverIdx:Int = -1, // dispatch receiver index: -1 in case of functions, -2 for constructors
3412
-
isBigArity:Boolean = false, // whether a big arity `invoke` is being extracted
3413
-
bigArityParameterTypes:List<IrType>? = null // parameter types used for the cast expressions in the big arity `invoke` invocation
3426
+
bigArityParameterTypes:List<IrType>? = null // parameter types used for the cast expressions in a big arity `invoke` invocation. null if not a big arity invocation.
3414
3427
) {
3415
3428
// Return statement of generated function:
3416
3429
val retId = tw.getFreshIdLabel<DbReturnstmt>()
@@ -3441,8 +3454,8 @@ open class KotlinFileExtractor(
@@ -3574,6 +3587,11 @@ open class KotlinFileExtractor(
3574
3587
logger.errorElement("Unexpected: property reference with non simple type. ${kPropertyType.classFqName?.asString()}", propertyReferenceExpr)
3575
3588
return
3576
3589
}
3590
+
val kPropertyClass = kPropertyType.classOrNull
3591
+
if (kPropertyClass ==null) {
3592
+
logger.errorElement("Cannot find class for kPropertyType. ${kPropertyType.classFqName?.asString()}", propertyReferenceExpr)
3593
+
return
3594
+
}
3577
3595
3578
3596
val locId = tw.getLocation(propertyReferenceExpr)
3579
3597
@@ -3587,7 +3605,7 @@ open class KotlinFileExtractor(
3587
3605
)
3588
3606
3589
3607
val currentDeclaration = declarationStack.peek()
3590
-
val prefix =if (kPropertyType.classOrNull!!.owner.name.asString().startsWith("KMutableProperty")) "Mutable"else""
3608
+
val prefix =if (kPropertyClass.owner.name.asString().startsWith("KMutableProperty")) "Mutable"else""
3591
3609
val baseClass = pluginContext.referenceClass(FqName("kotlin.jvm.internal.${prefix}PropertyReference${kPropertyType.arguments.size -1}"))?.owner?.typeWith()
3592
3610
?: pluginContext.irBuiltIns.anyType
3593
3611
@@ -3813,8 +3831,7 @@ open class KotlinFileExtractor(
3813
3831
expressionTypeArguments,
3814
3832
classTypeArguments,
3815
3833
dispatchReceiverIdx,
3816
-
isBigArity,
3817
-
parameterTypes.dropLast(1))
3834
+
if (isBigArity) parameterTypes.dropLast(1) elsenull)
3818
3835
3819
3836
val typeAccessArguments =if (isBigArity) listOf(parameterTypes.last()) else parameterTypes
0 commit comments