Skip to content

Commit

Permalink
⬆️ Update Kotlin to 1.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sebj committed Aug 23, 2023
1 parent 46e2ff5 commit f9c6d15
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/time.api
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public final class Relation : java/lang/Enum {
public static final field Meets LRelation;
public static final field Overlaps LRelation;
public static final field Starts LRelation;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public final fun isDisjoint ()Z
public final fun isEqual ()Z
public final fun isMeeting ()Z
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
kotlin("multiplatform") version "1.8.22"
kotlin("multiplatform") version "1.9.0"
`maven-publish`
id("signing")
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.13.2"
Expand Down
4 changes: 4 additions & 0 deletions src/appleMain/kotlin/Interop.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.UnsafeNumber
import kotlinx.cinterop.convert
import kotlinx.datetime.FixedOffsetTimeZone
Expand All @@ -8,6 +9,7 @@ import platform.Foundation.timeZoneForSecondsFromGMT
import platform.Foundation.timeZoneWithAbbreviation
import platform.Foundation.timeZoneWithName

@ExperimentalForeignApi
@UnsafeNumber(["ios_arm64: kotlin.Int", "ios_simulator_arm64: kotlin.Int", "ios_x64: kotlin.Int", "macos_arm64: kotlin.Int", "macos_x64: kotlin.Int", "tvos_arm64: kotlin.Int", "tvos_simulator_arm64: kotlin.Int", "tvos_x64: kotlin.Int", "watchos_arm32: kotlin.Int", "watchos_arm64: kotlin.Int", "watchos_simulator_arm64: kotlin.Int", "watchos_x64: kotlin.Int"])
public fun TimePeriod<*>.toNSDateComponents(): NSDateComponents {
val dateComponents = NSDateComponents()
Expand All @@ -32,6 +34,8 @@ public fun TimePeriod<*>.toNSDateComponents(): NSDateComponents {
* `DateTimeException` to denote that lossy conversion would happen, as Darwin internally rounds the offsets to the
* nearest minute.
*/
@ExperimentalForeignApi
@UnsafeNumber(["ios_arm64: kotlin.Int", "ios_simulator_arm64: kotlin.Int", "ios_x64: kotlin.Int", "macos_arm64: kotlin.Int", "macos_x64: kotlin.Int", "tvos_arm64: kotlin.Int", "tvos_simulator_arm64: kotlin.Int", "tvos_x64: kotlin.Int", "watchos_arm32: kotlin.Int", "watchos_arm64: kotlin.Int", "watchos_simulator_arm64: kotlin.Int", "watchos_x64: kotlin.Int"])
private fun TimeZone.toNSTimeZone(): NSTimeZone = if (this is FixedOffsetTimeZone) {
require(offset.totalSeconds % 60 == 0) {
"NSTimeZone cannot represent fixed-offset time zones with offsets not expressed in whole minutes: $this"
Expand Down

0 comments on commit f9c6d15

Please sign in to comment.