kevin.cianfarini
11/29/2022, 9:36 PMcompose-jb
? I’m trying to expose a molecule flow to an iOS framework and I’m getting the following error.
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
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
?kevin.cianfarini
11/29/2022, 9:37 PMkevin.cianfarini
11/29/2022, 9:41 PM* What went wrong:
Execution failed for task ':shared:compileIosMainKotlinMetadata'.
> Compilation finished with errors
kevin.cianfarini
11/29/2022, 9:55 PMiosMain
kevin.cianfarini
11/29/2022, 9:56 PMNikita Lipsky
11/30/2022, 12:30 PMkevin.cianfarini
11/30/2022, 12:58 PM