Usage of internal CodeVisionPlaceholderCollector

I got a verification error for using CodeVisionPlaceholderCollector which is an internal interface, without actually using it in a strict sense.

I implemented DaemonBoundCodeVisionProvider, which provides a default method -

fun getPlaceholderCollector(editor: Editor, psiFile: PsiFile?): CodeVisionPlaceholderCollector? = null

returning the interface, so I didn’t even know that I’m referencing CodeVisionPlaceholderCollector .

Is it supposed to be an error, and if so, how it should be fixed, by overriding method again and using on of GenericPlaceholderCollector/BypassBasedPlaceholderCollector which are inheritors of the internal interface, but not internal themselves?

This is most likely the Kotlin compiler inserting default bridge code in your implementation, https://kotlinlang.org/docs/compiler-reference.html#jvm-default-mode

You can fix this by configuring the compiler options in your build.gradle.kts file.
I’m using this, but all isn’t in the latest list of options. You may have to change this.

kotlin {
  compilerOptions {
     freeCompilerArgs = listOf("-Xjvm-default=all")
  }
}

Thank you, seems like it. I see a bridge method generated in the bytecode. I wonder why it’s like that if the target for plugins is java 21 now :thinking:

I ended up with this option

compilerOptions {
    jvmDefault.set(JvmDefaultMode.NO_COMPATIBILITY)
}