Does this stacktrace ring a bell to any of the fol...
# compose-desktop
k
Does this stacktrace ring a bell to any of the folks working on
compose-jb
? I’m trying to expose a molecule flow to an iOS framework and I’m getting the following error.
Copy code
e: org.jetbrains.kotlin.util.KotlinFrontEndException: Exception while analyzing expression at (36,9) in /Users/kevin/code/Flapjack/shared/src/iosMain/kotlin/energy/octopus/octopusenergy/viewmodel/iosBinding.kt
for the following code
Copy code
abstract class MoleculeViewModel<UiAction : Any, ViewState : Any> {

    /**
     * Ingest a [Flow] of [UiAction], react to those actions, and produce a [ViewState].
     */
    @Composable internal abstract fun viewState(events: Flow<UiAction>): ViewState
}

fun MoleculeViewModel<...>.subscribe(...) {
    ...
    val flow = coroutineScope.launchMolecule(RecompositionClock.Immediate) {
        this.viewState(events.consumeAsFlow())
    }
    ...
}
The full stacktrace is in the thread. It’s looking like an upstream
NullPointerException
?
It fails when compiling metadata.
Copy code
* What went wrong:
Execution failed for task ':shared:compileIosMainKotlinMetadata'.
> Compilation finished with errors
This looks like it might be related to defining different functions that depend on a composable in common in
iosMain
hoisting the function up to common main (which isn’t ideal) fixes the issue
n
Hi! It looks like a bug in Compose compiler plugin. Can you provide a reproducing example?
k
I can try to extract a sample 🙂