Skip to content

Restore binary compatibility of year() and monthNumber() #548

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

Merged

Conversation

dkhalanskyjb
Copy link
Collaborator

Fixes #545

@dkhalanskyjb dkhalanskyjb requested a review from ilya-g June 30, 2025 11:27
@@ -30,7 +30,7 @@ allprojects {
kotlinOptions.freeCompilerArgs += "-version"
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile>().configureEach {
compilerOptions { freeCompilerArgs.add("-Xjvm-default=disable") }
compilerOptions { freeCompilerArgs.add("-Xjvm-default=all-compatibility") }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks strange that we need to enable this mode. Have we ever shipped the library with jvm-default mode other than "disable" (which was default in previous kotlin versions)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, we haven't. The purpose of this PR is to be able to replace DateTimeFormatBuilder$WithDate$DefaultImpls with a custom one, containing the removed static methods. Without turning on jvm-default, the annotation @JvmDefaultWithoutCompatibility has no effect, which means DateTimeFormatBuilder$WithDate$DefaultImpls gets generated by the compiler.

We could keep the all-compatibility flag to make the annotation work, mark everything with the annotation, and write all DefaultImpls by ourselves, but I don't see the point, given that we'll want to migrate anyway.

@dkhalanskyjb dkhalanskyjb requested a review from ilya-g July 3, 2025 16:11
@dkhalanskyjb dkhalanskyjb force-pushed the dkhalanskyjb/restore-missing-static-default-method branch from bf56673 to fb6c423 Compare July 7, 2025 08:22
@dkhalanskyjb dkhalanskyjb mentioned this pull request Jul 7, 2025
@dkhalanskyjb dkhalanskyjb merged commit 19dfa80 into master Jul 7, 2025
1 check passed
@dkhalanskyjb dkhalanskyjb deleted the dkhalanskyjb/restore-missing-static-default-method branch July 7, 2025 12:00
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

Successfully merging this pull request may close these issues.

NoSuchMethodError "No static method year" with 0.7.0-0.6.x-compat
2 participants