PHondogo
10/27/2022, 7:42 AMopen class A {
@Composable
fun test(
x: String,
lambda: @Composable () -> Unit = {} // runtime exception below is caused by this parameter
) {
Text(x)
lambda()
}
}
open class B : A {
}
open class C : B { // C -> B - > A
@Composable
fun anotherTest() {
test("1") // while incremental compile (change for example "1" -> "2") throws runtime error: java.lang.ClassCastException: class androidx.compose.runtime.internal.ComposableLambdaImpl cannot be cast to class kotlin.jvm.functions.Function0
}
}
Compose Desktop version 1.3.0-alpha01-dev831
Edit: In my case A, B are located in one Gradle module, while C in another. But may be it will reproduce when all classes in the same module (I didn't check it).