Skip to content

Commit 21a35d5

Browse files
committed
Remove the $DefaultImpls for new interfaces
Generating `$DefaultImpls` for new interfaces is meaningless, as they won't be used anyway.
1 parent 427f595 commit 21a35d5

5 files changed

Lines changed: 14 additions & 14 deletions

File tree

core/api/kotlinx-datetime.api

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -688,11 +688,6 @@ public abstract interface class kotlinx/datetime/TimeZoneContext : kotlinx/datet
688688
public final class kotlinx/datetime/TimeZoneContext$Companion {
689689
}
690690

691-
public final class kotlinx/datetime/TimeZoneContext$DefaultImpls {
692-
public static fun currentTimeZone (Lkotlinx/datetime/TimeZoneContext;)Lkotlinx/datetime/TimeZone;
693-
public static fun get (Lkotlinx/datetime/TimeZoneContext;Ljava/lang/String;)Lkotlinx/datetime/TimeZone;
694-
}
695-
696691
public final class kotlinx/datetime/TimeZoneContext$System : kotlinx/datetime/TimeZoneContext {
697692
public static final field INSTANCE Lkotlinx/datetime/TimeZoneContext$System;
698693
public fun availableZoneIds ()Ljava/util/Set;
@@ -708,10 +703,6 @@ public abstract interface class kotlinx/datetime/TimeZoneDatabase {
708703
public abstract fun getOrNull (Ljava/lang/String;)Lkotlinx/datetime/TimeZone;
709704
}
710705

711-
public final class kotlinx/datetime/TimeZoneDatabase$DefaultImpls {
712-
public static fun get (Lkotlinx/datetime/TimeZoneDatabase;Ljava/lang/String;)Lkotlinx/datetime/TimeZone;
713-
}
714-
715706
public abstract interface class kotlinx/datetime/TimeZoneIdProvider {
716707
public abstract fun currentTimeZoneId ()Ljava/lang/String;
717708
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
* Copyright 2019-2026 JetBrains s.r.o. and contributors.
3+
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
4+
*/
5+
6+
package kotlinx.datetime
7+
8+
@OptIn(ExperimentalMultiplatform::class)
9+
@OptionalExpectation
10+
internal expect annotation class MyJvmDefaultWithoutCompatibility()
11+

core/common/src/TimeZoneContext.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import kotlinx.datetime.internal.systemTimezoneDatabase
1616
* Typically, the identifiers follow the IANA time zone conventions (https://www.iana.org/time-zones):
1717
* for example, `Europe/Berlin` or `America/Los_Angeles`.
1818
*/
19+
@MyJvmDefaultWithoutCompatibility
1920
public interface TimeZoneDatabase {
2021
/**
2122
* Returns the time zone identified by the provided [id].
@@ -83,6 +84,7 @@ public interface TimeZoneIdProvider {
8384
* but can additionally return a useful time zone
8485
* even when the [TimeZoneDatabase] does not recognize the timezone identifier.
8586
*/
87+
@MyJvmDefaultWithoutCompatibility
8688
public interface TimeZoneContext: TimeZoneDatabase, TimeZoneIdProvider {
8789
/**
8890
* Get the current time zone.

core/common/src/format/DateTimeFormatBuilder.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ import kotlinx.datetime.*
99
import kotlinx.datetime.internal.*
1010
import kotlinx.datetime.internal.format.*
1111

12-
@OptIn(ExperimentalMultiplatform::class)
13-
@OptionalExpectation
14-
internal expect annotation class MyJvmDefaultWithoutCompatibility()
15-
1612
/**
1713
* Common functions for all format builders.
1814
*

core/jvm/src/format/format/MyJvmDefaultWithoutCompatibility.kt renamed to core/jvm/src/MyJvmDefaultWithoutCompatibility.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file.
44
*/
55

6-
package kotlinx.datetime.format
6+
package kotlinx.datetime
77

88
internal actual typealias MyJvmDefaultWithoutCompatibility = JvmDefaultWithoutCompatibility

0 commit comments

Comments
 (0)