Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ZacSweers opened this issue Jun 14, 2024 · 2 comments
Assignees
Labels
bug Something isn't working compiler Compiler plugin related

Comments

@ZacSweers
Copy link

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 ZacSweers added bug Something isn't working submitted labels Jun 14, 2024
@ZacSweers
Copy link
Author

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

@luca992
Copy link
Contributor

luca992 commented Jun 18, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler Compiler plugin related
Projects
None yet
Development

No branches or pull requests

4 participants