diff --git a/build.gradle b/build.gradle index ab9fa84a..530f6c8b 100644 --- a/build.gradle +++ b/build.gradle @@ -90,7 +90,8 @@ allprojects { kotlinOptions { freeCompilerArgs += [ "-opt-in=kotlin.RequiresOptIn", - "-Xinline-classes" + "-Xinline-classes", + "-Xexpect-actual-classes" ] } } diff --git a/utils/src/commonMain/kotlin/com/motorro/rxlcemodel/common/Clock.kt b/utils/src/commonMain/kotlin/com/motorro/rxlcemodel/common/Clock.kt index 827dcf89..054db8c4 100644 --- a/utils/src/commonMain/kotlin/com/motorro/rxlcemodel/common/Clock.kt +++ b/utils/src/commonMain/kotlin/com/motorro/rxlcemodel/common/Clock.kt @@ -26,11 +26,8 @@ interface Clock { /** * System clock */ - val SYSTEM: Clock = SystemClock + val SYSTEM: Clock = getSystemClock() } } -/** - * System clock - */ -internal expect object SystemClock: Clock \ No newline at end of file +internal expect fun getSystemClock(): Clock diff --git a/utils/src/jsMain/kotlin/com/motorro/rxlcemodel/common/SystemClock.kt b/utils/src/jsMain/kotlin/com/motorro/rxlcemodel/common/SystemClock.kt index 25fd88bb..be20edbe 100644 --- a/utils/src/jsMain/kotlin/com/motorro/rxlcemodel/common/SystemClock.kt +++ b/utils/src/jsMain/kotlin/com/motorro/rxlcemodel/common/SystemClock.kt @@ -15,10 +15,7 @@ package com.motorro.rxlcemodel.common import kotlin.js.Date -/** - * System clock - */ -internal actual object SystemClock : Clock { +internal actual fun getSystemClock(): Clock = object : Clock { /** * Current milliseconds value */ diff --git a/utils/src/jvmMain/kotlin/com/motorro/rxlcemodel/common/SystemClock.kt b/utils/src/jvmMain/kotlin/com/motorro/rxlcemodel/common/SystemClock.kt index 74bf9d0d..a6d1dcd2 100644 --- a/utils/src/jvmMain/kotlin/com/motorro/rxlcemodel/common/SystemClock.kt +++ b/utils/src/jvmMain/kotlin/com/motorro/rxlcemodel/common/SystemClock.kt @@ -13,10 +13,7 @@ package com.motorro.rxlcemodel.common -/** - * System clock - */ -internal actual object SystemClock : Clock { +internal actual fun getSystemClock(): Clock = object : Clock { /** * Current milliseconds value */