Thread
#compose-web
    c

    CLOVIS

    4 months ago
    Is there a known bug with Compose for web and inheritance? I have something like
    interface Parent {
      @Composable
      fun render(...)
    }
    
    class Child {
      @Composable
      override fun render(...)
    }
    Calling the
    render
    function on a child leads to:
    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

    4 months ago
    Are you running the compiler against both source files? Are they in the same compilation unit or separate?
    c

    CLOVIS

    4 months ago
    They are both in the same Gradle project, however the interface is in
    commonMain
    and the implementation is in
    jsMain
    Ah, no, they're both in
    commonMain
    • Abstract method: https://kotlinlang.slack.com/archives/C01F2HV7868/p1653233265875689 • both implementations are in https://gitlab.com/opensavvy/clovis/-/blob/25-webpack/utils.ui/src/commonMain/kotlin/clovis.ui/navigation/Builders.kt It's far from being a minimal reproduction repo though, so please tell me if you need any more info
    Grégory Lureau

    Grégory Lureau

    4 months ago
    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).
    o

    Oleksandr Karpovich [JB]

    4 months ago
    @CLOVIS thanks for reporting.https://github.com/JetBrains/compose-jb/issues/2067 - here I added a more simple repro sample.
    c

    CLOVIS

    4 months ago
    @Grégory Lureau I should be on 1.6.21. Maybe you looked at the
    main
    branch (no problems there)? Otherwise, there might be something wrong in the config somewhere
    @Oleksandr Karpovich [JB] thanks, following the issue.