Skip to content

Commit d3a8060

Browse files
committed
Kotlin: Remove another not-null-expr in the extractor
1 parent 98dd244 commit d3a8060

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3405,8 +3405,7 @@ open class KotlinFileExtractor(
34053405
expressionTypeArgs: List<IrType>, // type arguments of the extracted expression
34063406
classTypeArgsIncludingOuterClasses: List<IrTypeArgument>?, // type arguments of the class containing the callable reference
34073407
dispatchReceiverIdx: Int = -1, // dispatch receiver index: -1 in case of functions, -2 for constructors
3408-
isBigArity: Boolean = false, // whether a big arity `invoke` is being extracted
3409-
bigArityParameterTypes: List<IrType>? = null // parameter types used for the cast expressions in the big arity `invoke` invocation
3408+
bigArityParameterTypes: List<IrType>? = null // parameter types used for the cast expressions in a big arity `invoke` invocation. null if not a big arity invocation.
34103409
) {
34113410
// Return statement of generated function:
34123411
val retId = tw.getFreshIdLabel<DbReturnstmt>()
@@ -3464,10 +3463,10 @@ open class KotlinFileExtractor(
34643463
extensionIdxOffset = 0
34653464
}
34663465

3467-
if (isBigArity) {
3466+
if (bigArityParameterTypes != null) {
34683467
// In case we're extracting a big arity function reference:
34693468
addArgumentsToInvocationInInvokeNBody(
3470-
bigArityParameterTypes!!, labels, retId, callId, locId,
3469+
bigArityParameterTypes, labels, retId, callId, locId,
34713470
{ exp -> writeExpressionMetadataToTrapFile(exp, labels.methodId, retId) },
34723471
extensionIdxOffset, useFirstArgAsDispatch, dispatchReceiverIdx)
34733472
} else {
@@ -3814,8 +3813,7 @@ open class KotlinFileExtractor(
38143813
expressionTypeArguments,
38153814
classTypeArguments,
38163815
dispatchReceiverIdx,
3817-
isBigArity,
3818-
parameterTypes.dropLast(1))
3816+
if (isBigArity) parameterTypes.dropLast(1) else null)
38193817

38203818
val typeAccessArguments = if (isBigArity) listOf(parameterTypes.last()) else parameterTypes
38213819
if (target is IrConstructorSymbol) {

0 commit comments

Comments
 (0)