@@ -1436,12 +1436,14 @@ open class KotlinFileExtractor(
1436
1436
// type arguments at index -2, -3, ...
1437
1437
extractTypeArguments(typeArguments, locId, id, enclosingCallable, enclosingStmt, - 2 , true )
1438
1438
1439
- val isFunctionInvoke = drType != null
1440
- && drType is IrSimpleType
1441
- && drType.isFunctionOrKFunction()
1442
- && callTarget.name.asString() == OperatorNameConventions .INVOKE .asString()
1443
- val isBigArityFunctionInvoke = isFunctionInvoke
1444
- && (drType as IrSimpleType ).arguments.size > BuiltInFunctionArity .BIG_ARITY
1439
+ val (isFunctionInvoke, isBigArityFunctionInvoke) =
1440
+ if (drType is IrSimpleType &&
1441
+ drType.isFunctionOrKFunction() &&
1442
+ callTarget.name.asString() == OperatorNameConventions .INVOKE .asString()) {
1443
+ Pair (true , drType.arguments.size > BuiltInFunctionArity .BIG_ARITY )
1444
+ } else {
1445
+ Pair (false , false )
1446
+ }
1445
1447
1446
1448
if (callTarget.isLocalFunction()) {
1447
1449
val ids = getLocallyVisibleFunctionLabels(callTarget)
@@ -1452,7 +1454,7 @@ open class KotlinFileExtractor(
1452
1454
extractNewExprForLocalFunction(ids, id, locId, enclosingCallable, enclosingStmt)
1453
1455
} else {
1454
1456
val methodId =
1455
- if (drType != null && extractClassTypeArguments && drType is IrSimpleType && ! isUnspecialised(drType)) {
1457
+ if (extractClassTypeArguments && drType is IrSimpleType && ! isUnspecialised(drType)) {
1456
1458
1457
1459
val extractionMethod = if (isFunctionInvoke) {
1458
1460
// For `kotlin.FunctionX` and `kotlin.reflect.KFunctionX` interfaces, we're making sure that we
0 commit comments