Another issue with 2.2.20. When upgrading Kotlin f...
# compose-web
r
Another issue with 2.2.20. When upgrading Kotlin from 2.2.10-RC2 to 2.2.20-Beta2 (or 2.2.20-RC-233) I see IrLinkageError error. More in 🧵
The generated JS code contains this:
Copy code
throwIrLinkageError("Function 'width' can not be called: No function found for symbol 'dev.kilua.html.style/CssStyle.width|width(dev.kilua.html.CssSize?;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]'");
The same error is also on wasmJs target.
Perhaps someone has seen something like this?
I've simplified my problem. With earlier versions of Kotlin compiler I could do this:
Copy code
buttonRef("test").onClick {
    console.log("Button clicked!")
}
(
buttoRef()
returns an object of type
TagEvents
, and
onClick
is a
@Composable
method of
TagEvents
.)
With 2.2.20 it doesn't work. This is generated in code:
Copy code
throwIrLinkageError("Function 'onClick' can not be called: No function found for symbol 'dev.kilua.html/Button.onClick|onClick(kotlin.Function1<web.mouse.MouseEvent,kotlin.Unit>;androidx.compose.runtime.Composer?;kotlin.Int;kotlin.Int){}[0]'");
}
But I can introduce a composable wrapper and it works again:
Copy code
val wrapper: @Composable TagEvents.() -> Unit = {
    onClick {
        console.log("Button clicked!")
    }
}
buttonRef("test").wrapper()
j
You should report these in #C0KLZSCHF
r
You are probably right 🙂