Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Kotlin 2.0 #411

Open
technoir42 opened this issue Jul 30, 2024 · 4 comments
Open

Support Kotlin 2.0 #411

technoir42 opened this issue Jul 30, 2024 · 4 comments

Comments

@technoir42
Copy link

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");
}
@NeonMika
Copy link

NeonMika commented Aug 7, 2024

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.DEFAULT field removed
Use org.jetbrains.kotlin.config.JvmDefaultMode.DISABLE.

@technoir42
Copy link
Author

I switched to this fork which supports Kotlin 2.0: https://github.com/ZacSweers/kotlin-compile-testing

@IceBlizz6
Copy link

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.

@solonovamax
Copy link

A solution for KSP can be found here: ZacSweers#296 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants