From 52f7b33cbb1cecde8afdfd121eed049cf8222a5d Mon Sep 17 00:00:00 2001 From: Stefan Mogeritsch Date: Wed, 10 Dec 2025 09:06:48 +0100 Subject: [PATCH] fix `expect'/'actual' classes (including interfaces, objects, annotations, enums, and 'actual' typealiases) are in Beta. Consider using the '-Xexpect-actual-classes' flag to suppress this warning. Also see: https://youtrack.jetbrains.com/issue/KT-61573 --- .../at/mocode/frontend/core/localdb/DatabaseProvider.kt | 2 ++ .../at/mocode/frontend/core/localdb/DatabaseProvider.js.kt | 2 ++ .../at/mocode/frontend/core/localdb/DatabaseProvider.jvm.kt | 2 ++ .../kotlin/at/mocode/frontend/core/network/PlatformConfig.kt | 1 + .../at/mocode/frontend/core/network/PlatformConfig.js.kt | 2 +- .../at/mocode/frontend/core/network/PlatformConfig.jvm.kt | 1 + .../at/mocode/clients/authfeature/di/AuthFeatureModule.kt | 5 ++++- .../mocode/clients/authfeature/oauth/AuthCallbackParams.kt | 1 + .../kotlin/at/mocode/clients/authfeature/oauth/OAuthPkce.kt | 1 + .../mocode/clients/authfeature/oauth/AuthCallbackParamsJs.kt | 1 + .../at/mocode/clients/authfeature/oauth/OAuthPkceJs.kt | 1 + 11 files changed, 17 insertions(+), 2 deletions(-) diff --git a/frontend/core/local-db/src/commonMain/kotlin/at/mocode/frontend/core/localdb/DatabaseProvider.kt b/frontend/core/local-db/src/commonMain/kotlin/at/mocode/frontend/core/localdb/DatabaseProvider.kt index 98458d64..e354cd99 100644 --- a/frontend/core/local-db/src/commonMain/kotlin/at/mocode/frontend/core/localdb/DatabaseProvider.kt +++ b/frontend/core/local-db/src/commonMain/kotlin/at/mocode/frontend/core/localdb/DatabaseProvider.kt @@ -1,3 +1,5 @@ +@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") + package at.mocode.frontend.core.localdb import app.cash.sqldelight.db.SqlDriver diff --git a/frontend/core/local-db/src/jsMain/kotlin/at/mocode/frontend/core/localdb/DatabaseProvider.js.kt b/frontend/core/local-db/src/jsMain/kotlin/at/mocode/frontend/core/localdb/DatabaseProvider.js.kt index 14f8822d..9a710f4f 100644 --- a/frontend/core/local-db/src/jsMain/kotlin/at/mocode/frontend/core/localdb/DatabaseProvider.js.kt +++ b/frontend/core/local-db/src/jsMain/kotlin/at/mocode/frontend/core/localdb/DatabaseProvider.js.kt @@ -1,3 +1,5 @@ +@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") + package at.mocode.frontend.core.localdb import app.cash.sqldelight.db.SqlDriver diff --git a/frontend/core/local-db/src/jvmMain/kotlin/at/mocode/frontend/core/localdb/DatabaseProvider.jvm.kt b/frontend/core/local-db/src/jvmMain/kotlin/at/mocode/frontend/core/localdb/DatabaseProvider.jvm.kt index 0cf22e05..594d7a1e 100644 --- a/frontend/core/local-db/src/jvmMain/kotlin/at/mocode/frontend/core/localdb/DatabaseProvider.jvm.kt +++ b/frontend/core/local-db/src/jvmMain/kotlin/at/mocode/frontend/core/localdb/DatabaseProvider.jvm.kt @@ -1,3 +1,5 @@ +@file:Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") + package at.mocode.frontend.core.localdb import app.cash.sqldelight.db.SqlDriver diff --git a/frontend/core/network/src/commonMain/kotlin/at/mocode/frontend/core/network/PlatformConfig.kt b/frontend/core/network/src/commonMain/kotlin/at/mocode/frontend/core/network/PlatformConfig.kt index 69553360..76a50dc6 100644 --- a/frontend/core/network/src/commonMain/kotlin/at/mocode/frontend/core/network/PlatformConfig.kt +++ b/frontend/core/network/src/commonMain/kotlin/at/mocode/frontend/core/network/PlatformConfig.kt @@ -1,5 +1,6 @@ package at.mocode.frontend.core.network +@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") expect object PlatformConfig { fun resolveApiBaseUrl(): String } diff --git a/frontend/core/network/src/jsMain/kotlin/at/mocode/frontend/core/network/PlatformConfig.js.kt b/frontend/core/network/src/jsMain/kotlin/at/mocode/frontend/core/network/PlatformConfig.js.kt index bf7aa8ed..fd9c79da 100644 --- a/frontend/core/network/src/jsMain/kotlin/at/mocode/frontend/core/network/PlatformConfig.js.kt +++ b/frontend/core/network/src/jsMain/kotlin/at/mocode/frontend/core/network/PlatformConfig.js.kt @@ -2,7 +2,7 @@ package at.mocode.frontend.core.network import kotlinx.browser.window -@Suppress("UnsafeCastFromDynamic") +@Suppress("UnsafeCastFromDynamic", "EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") actual object PlatformConfig { actual fun resolveApiBaseUrl(): String { // 1) Prefer a global JS variable (can be injected by index.html or nginx) diff --git a/frontend/core/network/src/jvmMain/kotlin/at/mocode/frontend/core/network/PlatformConfig.jvm.kt b/frontend/core/network/src/jvmMain/kotlin/at/mocode/frontend/core/network/PlatformConfig.jvm.kt index 485f6804..5e60397f 100644 --- a/frontend/core/network/src/jvmMain/kotlin/at/mocode/frontend/core/network/PlatformConfig.jvm.kt +++ b/frontend/core/network/src/jvmMain/kotlin/at/mocode/frontend/core/network/PlatformConfig.jvm.kt @@ -1,5 +1,6 @@ package at.mocode.frontend.core.network +@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") actual object PlatformConfig { actual fun resolveApiBaseUrl(): String { // Prefer environment variable diff --git a/frontend/features/auth-feature/src/commonMain/kotlin/at/mocode/clients/authfeature/di/AuthFeatureModule.kt b/frontend/features/auth-feature/src/commonMain/kotlin/at/mocode/clients/authfeature/di/AuthFeatureModule.kt index 50e866da..d9d5b271 100644 --- a/frontend/features/auth-feature/src/commonMain/kotlin/at/mocode/clients/authfeature/di/AuthFeatureModule.kt +++ b/frontend/features/auth-feature/src/commonMain/kotlin/at/mocode/clients/authfeature/di/AuthFeatureModule.kt @@ -23,7 +23,10 @@ val authFeatureModule = module { // Bridge to core network TokenProvider without adding a hard dependency there single { object : TokenProvider { - override fun getAccessToken(): String? = get().getToken() + override fun getAccessToken(): String? { + val token = get().getToken() + return token + } } } } diff --git a/frontend/features/auth-feature/src/commonMain/kotlin/at/mocode/clients/authfeature/oauth/AuthCallbackParams.kt b/frontend/features/auth-feature/src/commonMain/kotlin/at/mocode/clients/authfeature/oauth/AuthCallbackParams.kt index ffe6ddfe..ec381198 100644 --- a/frontend/features/auth-feature/src/commonMain/kotlin/at/mocode/clients/authfeature/oauth/AuthCallbackParams.kt +++ b/frontend/features/auth-feature/src/commonMain/kotlin/at/mocode/clients/authfeature/oauth/AuthCallbackParams.kt @@ -2,6 +2,7 @@ package at.mocode.clients.authfeature.oauth data class CallbackParams(val code: String, val state: String?) +@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") expect object AuthCallbackParams { /** * Parse OAuth callback parameters from the current environment. diff --git a/frontend/features/auth-feature/src/commonMain/kotlin/at/mocode/clients/authfeature/oauth/OAuthPkce.kt b/frontend/features/auth-feature/src/commonMain/kotlin/at/mocode/clients/authfeature/oauth/OAuthPkce.kt index a26eaa72..40d0b3aa 100644 --- a/frontend/features/auth-feature/src/commonMain/kotlin/at/mocode/clients/authfeature/oauth/OAuthPkce.kt +++ b/frontend/features/auth-feature/src/commonMain/kotlin/at/mocode/clients/authfeature/oauth/OAuthPkce.kt @@ -19,6 +19,7 @@ object OAuthParams { * For the desktop (JVM) target we currently do not start a browser flow, * but we provide hashing to keep API parity. */ +@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") expect object OAuthPkceService { /** Starts a PKCE auth attempt and stores transient state in memory. */ suspend fun startAuth(): PkceState diff --git a/frontend/features/auth-feature/src/jsMain/kotlin/at/mocode/clients/authfeature/oauth/AuthCallbackParamsJs.kt b/frontend/features/auth-feature/src/jsMain/kotlin/at/mocode/clients/authfeature/oauth/AuthCallbackParamsJs.kt index 265319c1..eed09385 100644 --- a/frontend/features/auth-feature/src/jsMain/kotlin/at/mocode/clients/authfeature/oauth/AuthCallbackParamsJs.kt +++ b/frontend/features/auth-feature/src/jsMain/kotlin/at/mocode/clients/authfeature/oauth/AuthCallbackParamsJs.kt @@ -2,6 +2,7 @@ package at.mocode.clients.authfeature.oauth import kotlinx.browser.window +@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") actual object AuthCallbackParams { actual fun parse(): CallbackParams? { val search = window.location.search diff --git a/frontend/features/auth-feature/src/jsMain/kotlin/at/mocode/clients/authfeature/oauth/OAuthPkceJs.kt b/frontend/features/auth-feature/src/jsMain/kotlin/at/mocode/clients/authfeature/oauth/OAuthPkceJs.kt index c7295bc3..d6634350 100644 --- a/frontend/features/auth-feature/src/jsMain/kotlin/at/mocode/clients/authfeature/oauth/OAuthPkceJs.kt +++ b/frontend/features/auth-feature/src/jsMain/kotlin/at/mocode/clients/authfeature/oauth/OAuthPkceJs.kt @@ -43,6 +43,7 @@ private fun sha256(input: String): Promise { return subtle.digest("SHA-256", data) as Promise } +@Suppress("EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING") actual object OAuthPkceService { actual suspend fun startAuth(): PkceState { val codeVerifier = randomUrlSafe(64)