Skip to content

Commit db1661f

Browse files
committed
Kotlin: Remove cast from extractRawMethodAccess
I'm not entirely happy with this, but it at least meets the goal of removing the cast.
1 parent 3eab35d commit db1661f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,12 +1427,14 @@ open class KotlinFileExtractor(
14271427
// type arguments at index -2, -3, ...
14281428
extractTypeArguments(typeArguments, locId, id, enclosingCallable, enclosingStmt, -2, true)
14291429

1430-
val isFunctionInvoke =
1431-
drType is IrSimpleType
1432-
&& drType.isFunctionOrKFunction()
1433-
&& callTarget.name.asString() == OperatorNameConventions.INVOKE.asString()
1434-
val isBigArityFunctionInvoke = isFunctionInvoke
1435-
&& (drType as IrSimpleType).arguments.size > BuiltInFunctionArity.BIG_ARITY
1430+
val (isFunctionInvoke, isBigArityFunctionInvoke) =
1431+
if (drType is IrSimpleType &&
1432+
drType.isFunctionOrKFunction() &&
1433+
callTarget.name.asString() == OperatorNameConventions.INVOKE.asString()) {
1434+
Pair(true, drType.arguments.size > BuiltInFunctionArity.BIG_ARITY)
1435+
} else {
1436+
Pair(false, false)
1437+
}
14361438

14371439
if (callTarget.isLocalFunction()) {
14381440
val ids = getLocallyVisibleFunctionLabels(callTarget)

0 commit comments

Comments
 (0)