compose-multiplatform icon indicating copy to clipboard operation
compose-multiplatform copied to clipboard

Compose compiler build failure on iOS simulator compilation: Compilation failed: No such value argument slot in IrCallImpl: 3 (total=3)

Open ZacSweers opened this issue 1 year ago • 2 comments

Describe the bug When compiling the referenced repro project for iOS simulator, compilation fails.

Affected platforms

  • iOS

Versions

  • Libraries:
    • Compose Multiplatform version: 1.6.11
    • Compose compiler (bundled with K2) 2.0.0
  • Kotlin version: 2.0.0
  • OS version(s) (required for Desktop and iOS issues): iOS 17.5 (21F77) SDK + iOS 17.5 (21F79) Simulator (Installed)
  • OS architecture (x86 or arm64):arm64
  • Device (model or simulator for iOS issues): iOS 17.2 (21C62) Simulator (Installed)

To Reproduce Steps to reproduce the behavior:

  1. Checkout this repo at main: https://github.com/ZacSweers/FieldSpottr
  2. Run ./gradlew :compileKotlinIosSimulatorArm64

Observe the below

> Task :compileKotlinIosSimulatorArm64 FAILED
e: Compilation failed: No such value argument slot in IrCallImpl: 3 (total=3)
 * Source files: DbArea.kt, DbPermit.kt, FSDatabase.kt, FsdbQueries.kt, FSDatabaseImpl.kt, DateSelector.kt, FSAppDirs.kt, FieldSpottrApp.kt, GroupSelector.kt, Home.kt, PermitGrid.kt, Area.kt, PermitRepository.kt, db.kt, Parceling.common.kt, Color.kt, Theme.kt, Type.kt, db.native.kt, Parceling.native.kt
 * Compiler version: 2.0.0
 * Output kind: LIBRARY
e: java.lang.AssertionError: No such value argument slot in IrCallImpl: 3 (total=3)
        at org.jetbrains.kotlin.ir.expressions.IrExpressionsKt.checkArgumentSlotAccess(IrExpressions.kt:73)
        at org.jetbrains.kotlin.ir.expressions.IrMemberAccessExpression.putValueArgument(IrMemberAccessExpression.kt:50)
        at androidx.compose.compiler.plugins.kotlin.lower.ComposerParamTransformer.withComposerParamIfNeeded(ComposerParamTransformer.kt:248)
        at androidx.compose.compiler.plugins.kotlin.lower.ComposerParamTransformer$copyWithComposerParam$2$5.visitCall(ComposerParamTransformer.kt:641)
        at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.kt:299)
        at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitCall(IrElementTransformerVoid.kt:19)
        at org.jetbrains.kotlin.ir.expressions.IrCall.accept(IrCall.kt:24)
        at org.jetbrains.kotlin.ir.expressions.IrExpression.transform(IrExpression.kt:24)
        at org.jetbrains.kotlin.ir.expressions.IrExpression.transform(IrExpression.kt:20)
        at org.jetbrains.kotlin.ir.util.TransformKt.transformInPlace(transform.kt:35)
        at org.jetbrains.kotlin.ir.expressions.IrBlockBody.transformChildren(IrBlockBody.kt:27)
        at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitBody(IrElementTransformerVoid.kt:174)
        at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitBlockBody(IrElementTransformerVoid.kt:188)
        at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitBlockBody(IrElementTransformerVoid.kt:191)
        at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitBlockBody(IrElementTransformerVoid.kt:19)
        at org.jetbrains.kotlin.ir.expressions.IrBlockBody.accept(IrBlockBody.kt:20)
        at org.jetbrains.kotlin.ir.expressions.IrBody.transform(IrBody.kt:20)
        at org.jetbrains.kotlin.ir.declarations.IrFunction.transformChildren(IrFunction.kt:58)
        at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoidKt.transformChildrenVoid(IrElementTransformerVoid.kt:565)
        at androidx.compose.compiler.plugins.kotlin.lower.ComposerParamTransformer.copyWithComposerParam(ComposerParamTransformer.kt:593)
        at androidx.compose.compiler.plugins.kotlin.lower.ComposerParamTransformer.withComposerParamIfNeeded(ComposerParamTransformer.kt:372)
        at androidx.compose.compiler.plugins.kotlin.lower.ComposerParamTransformer.visitSimpleFunction(ComposerParamTransformer.kt:158)
        at org.jetbrains.kotlin.ir.visitors.IrElementTransformerVoid.visitSimpleFunction(IrElementTransformerVoid.kt:131)

Expected behavior It should compile successfully or offer a meaningful error message

ZacSweers avatar Jun 14 '24 20:06 ZacSweers

figured this out after hopping into a debugger during compilation. The actual issue was a missing actual declaration for a compose function. Possibly worth closing this, but also think it's worth an improved error message

ZacSweers avatar Jun 17 '24 16:06 ZacSweers

Same usually, usually missing actual throws a readable error. A better error would be appreciated

luca992 avatar Jun 18 '24 21:06 luca992

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

okushnikov avatar Aug 26 '24 13:08 okushnikov