Is there a known bug with Compose for web and inheritance?
I have something like
Copy code
interface Parent {
@Composable
fun render(...)
}
class Child {
@Composable
override fun render(...)
}
Calling the
render
function on a child leads to:
Copy code
Uncaught TypeError: $localVariable.render$composable_49qbjn_k$ is not a function
at eval (Navigation.kt?fd6e:149:17)
After inspecting the object, its prototype has a
'render_4kj0y7_k$'
function. Did something go wrong when Compose/Kotlin mangled the object?
Adding
@JvmName("render")
to the parent class changes the function name in the error message, but it doesn't change which functions the object implements (its prototype still has `'render_4kj0y7_k$'`and not
'render'
)
j
jw
05/22/2022, 6:19 PM
Are you running the compiler against both source files? Are they in the same compilation unit or separate?
c
CLOVIS
05/22/2022, 6:54 PM
They are both in the same Gradle project, however the interface is in
KotlinJs had a mangling issue on 1.6.20 (fixed on 1.6.21) but looks like you're on 1.5.31 (not sure if this version also had mangling issues, but maybe worth trying an upgrade).