Support Kotlin 2.0
I'm facing the following error when running a test against Kotlin 2.0.10-RC2:
java.lang.NoSuchFieldError: DEFAULT
at com.tschuchort.compiletesting.KotlinCompilation.<init>(KotlinCompilation.kt:143)
KotlinCompilation is trying to access JvmDefaultMode.DEFAULT:
var jvmDefault: String = JvmDefaultMode.DEFAULT.description
JvmDefaultMode no longer has DEFAULT in Kotlin 2.0.10-RC2:
package org.jetbrains.kotlin.config
enum class JvmDefaultMode(val description: String) {
DISABLE("disable"),
ALL_COMPATIBILITY("all-compatibility"),
ALL("all");
}
I have the same issue.
See https://plugins.jetbrains.com/docs/intellij/api-changes-list-2024.html#kotlin-plugin-20241
org.jetbrains.kotlin.config.JvmDefaultMode.DEFAULTfield removed Useorg.jetbrains.kotlin.config.JvmDefaultMode.DISABLE.
I switched to this fork which supports Kotlin 2.0: https://github.com/ZacSweers/kotlin-compile-testing
Would be great if this could be solved in the near future, i'm working on multiple KSP projects that could benefit from this.
I switched to this fork which supports Kotlin 2.0: https://github.com/ZacSweers/kotlin-compile-testing
Could you provide some sample code that works in 2.0 for this fork? it seems to just ignore my symbol processor.
A solution for KSP can be found here: https://github.com/ZacSweers/kotlin-compile-testing/issues/296#issuecomment-2451011186
Any updates?
Any updates?
+1
A solution for KSP can be found here: ZacSweers#296 (comment)
unfortunately not, that ZacSweeters library is buggy as hell, e.g. doesn't even run processors in KMP 2.2!
This library seems pretty dead now sadly. last commit was 18 months ago.