I am working on a project with Compose, I have not...
# compose
s
I am working on a project with Compose, I have not made any code changes, and I'm suddenly running into abstract method errors and seeing warnings:
Detected a @Composable function that overrides an open function compiled with older compiler that is known to crash at runtime. Consider recompiling the dependency with a newer compiler version (>= 2.1.20) to get correct behavior. See <https://issuetracker.google.com/165812010> for more details.
This is impossible because the open function in question is in the same project?
I'm not sure what's happening here?
Copy code
interface ComposeEditor<T : Any> {
    @Composable
    fun CreateEditor(type: KClass<out T>, value: T?, onValueChange: (T) -> Unit = {})
}
This is my base class
And the editor
Copy code
object StringEditor : ComposeEditor<String> {
    @Composable
    override fun CreateEditor(type: KClass<out String>, value: String?, onValueChange: (String) -> Unit) {
        TextField(
            value = value ?: "",
            onValueChange = onValueChange
        )
    }
}
I get
java.lang.AbstractMethodError: Receiver class dev.wildware.udea.editors.StringEditor does not define or inherit an implementation of the resolved method 'abstract void CreateEditor(kotlin.reflect.KClass, java.lang.Object, kotlin.jvm.functions.Function1, androidx.compose.runtime.Composer, int)' of interface dev.wildware.udea.editors.ComposeEditor.
The composable was working absolutely fine and then it suddenly started throwing this error, when I wasn't modifying anything to do with the method signature.
b
Did any dependencies get updated?
p
I don't think default values are allow for composable functions on an interface (onValueChange in this case)
🙌 1
s
@Pearce Keesling That was it - thanks.
👍 1
I think my IDE added it in when I was Alt + Insert fixing some other issues
Or Jetbrains AI added it lol
Sneaky
p
The error is super unhelpful. I've been bitten by that a bunch
s
This diagnostic is a bit broken rn, aiming to fix that in 2.2 Feel free to ignore it
The default parameters should be supported, if they don't work - that's a bug
1