diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
index 8ad8c861..f7601276 100644
--- a/.idea/kotlinc.xml
+++ b/.idea/kotlinc.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/KMPNativeCoroutinesAsync/AsyncFunction.swift b/KMPNativeCoroutinesAsync/AsyncFunction.swift
index 511f0e58..840b24cf 100644
--- a/KMPNativeCoroutinesAsync/AsyncFunction.swift
+++ b/KMPNativeCoroutinesAsync/AsyncFunction.swift
@@ -18,6 +18,14 @@ public func asyncFunction(
try await AsyncFunctionTask(nativeSuspend: nativeSuspend).awaitResult()
}
+/// This function provides source compatibility during the migration to Swift export.
+///
+/// This is a no-op function and it can be safely removed once you have fully migrated to Swift export.
+@available(*, deprecated, message: "Kotlin Coroutines are supported by Swift export")
+public func asyncFunction(for result: Result) async -> Result {
+ return result
+}
+
/// Wraps the `NativeSuspend` in an async function.
/// - Parameter nativeSuspend: The native suspend function to await.
/// - Throws: Errors thrown by the `nativeSuspend`.
diff --git a/KMPNativeCoroutinesAsync/AsyncResult.swift b/KMPNativeCoroutinesAsync/AsyncResult.swift
index 247ef565..384bba1d 100644
--- a/KMPNativeCoroutinesAsync/AsyncResult.swift
+++ b/KMPNativeCoroutinesAsync/AsyncResult.swift
@@ -20,6 +20,20 @@ public func asyncResult(
}
}
+/// This function provides source compatibility during the migration to Swift export.
+///
+/// Once you have fully migrated to Swift export you can replace this function with a do-catch.
+@available(*, deprecated, message: "Kotlin Coroutines are supported by Swift export")
+public func asyncResult(
+ for output: @autoclosure () async throws -> Output
+) async -> Result {
+ do {
+ return .success(try await output())
+ } catch {
+ return .failure(error)
+ }
+}
+
/// Awaits the `NativeSuspend` and returns the result.
/// - Parameter nativeSuspend: The native suspend function to await.
/// - Returns: The `Result` from the `nativeSuspend`.
diff --git a/KMPNativeCoroutinesCombine/Future.swift b/KMPNativeCoroutinesCombine/Future.swift
index 6fc144ab..ce53e2b5 100644
--- a/KMPNativeCoroutinesCombine/Future.swift
+++ b/KMPNativeCoroutinesCombine/Future.swift
@@ -18,6 +18,17 @@ public func createFuture(
.eraseToAnyPublisher()
}
+/// This function provides source compatibility during the migration to Swift export.
+///
+/// You should migrate away from this function once you have fully migrated to Swift export.
+@available(*, deprecated, message: "Kotlin Coroutines are supported by Swift export")
+public func createFuture(
+ for operation: @escaping () async throws -> Result
+) -> AnyPublisher {
+ return TaskFuture(operation: operation)
+ .eraseToAnyPublisher()
+}
+
/// Creates an `AnyPublisher` for the provided `NativeSuspend`.
/// - Parameter nativeSuspend: The native suspend function to await.
/// - Returns: A publisher that either finishes with a single value or fails with an error.
@@ -78,3 +89,51 @@ internal class NativeSuspendSubscription:
nativeCancellable = nil
}
}
+
+internal struct TaskFuture: Publisher {
+
+ typealias Output = Result
+ typealias Failure = Error
+
+ let operation: () async throws -> Result
+
+ func receive(subscriber: S) where S : Subscriber, any Failure == S.Failure, Result == S.Input {
+ let subscription = TaskSubscription(operation: operation, subscriber: subscriber)
+ subscriber.receive(subscription: subscription)
+ }
+}
+
+internal class TaskSubscription: Subscription where S.Input == Result, S.Failure == Error {
+
+ private var operation: (() async throws -> Result)?
+ private var task: Task? = nil
+ private var subscriber: S?
+
+ init(operation: @escaping () async throws -> Result, subscriber: S) {
+ self.operation = operation
+ self.subscriber = subscriber
+ }
+
+ func request(_ demand: Subscribers.Demand) {
+ guard let operation = operation, demand >= 1 else { return }
+ self.operation = nil
+ task = Task {
+ do {
+ let result = try await operation()
+ if let subscriber = self.subscriber {
+ _ = subscriber.receive(result)
+ subscriber.receive(completion: .finished)
+ }
+ } catch {
+ self.subscriber?.receive(completion: .failure(error))
+ }
+ }
+ }
+
+ func cancel() {
+ subscriber = nil
+ operation = nil
+ task?.cancel()
+ task = nil
+ }
+}
diff --git a/KMPNativeCoroutinesRxSwift/Single.swift b/KMPNativeCoroutinesRxSwift/Single.swift
index dfe6cfda..5e3be15b 100644
--- a/KMPNativeCoroutinesRxSwift/Single.swift
+++ b/KMPNativeCoroutinesRxSwift/Single.swift
@@ -17,6 +17,29 @@ public func createSingle(
return createSingleImpl(for: nativeSuspend)
}
+/// This function provides source compatibility during the migration to Swift export.
+///
+/// You should migrate away from this function once you have fully migrated to Swift export.
+@available(*, deprecated, message: "Kotlin Coroutines are supported by Swift export")
+@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
+public func createSingle(
+ for operation: @escaping () async throws -> Result
+) -> Single {
+ return Single.deferred {
+ return Single.create { observer in
+ let task = Task {
+ do {
+ let result = try await operation()
+ observer(.success(result))
+ } catch {
+ observer(.failure(error))
+ }
+ }
+ return Disposables.create { task.cancel() }
+ }
+ }
+}
+
/// Creates a `Single` for the provided `NativeSuspend`.
/// - Parameter nativeSuspend: The native suspend function to await.
/// - Returns: A single that either finishes with a single value or fails with an error.
diff --git a/SWIFT_EXPORT.md b/SWIFT_EXPORT.md
index d3bd22d1..5d02ca3b 100644
--- a/SWIFT_EXPORT.md
+++ b/SWIFT_EXPORT.md
@@ -31,6 +31,13 @@ For now the plugin just clones your original functions and properties to prevent
**Temporary workaround:**
You should disable any relevant code in Swift if you would like to try Swift export.
+## 🚨 `@Throws` suspend functions are unsupported
+
+Throwing suspend functions aren't supported yet.
+
+KMP-NativeCoroutines behaves as if a `@Throws(Exception::class)` annotation was added to all suspend functions.
+Since throwing suspend functions aren't supported yet, any exception will currently cause a fatal crash.
+
## ⚠️ `@ObjCName` is ignored
The `@ObjCName` annotation is (currently) ignored by Swift export.
diff --git a/build.gradle.kts b/build.gradle.kts
index 1dbd95e0..c75b6db9 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -13,7 +13,7 @@ buildscript {
allprojects {
group = "com.rickclephas.kmp"
- version = "1.0.0-ALPHA-48"
+ version = "1.0.0-ALPHA-48-kotlin-2.3.0-Beta2"
}
apiValidation {
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 5128e01d..714d49b4 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -1,5 +1,5 @@
[versions]
-kotlin = "2.2.21"
+kotlin = "2.3.0-Beta2"
kotlin-idea = "2.2.0-ij251-78"
kotlinx-coroutines = "1.10.1"
kotlinx-binary-compatibility-validator = "0.16.3"
diff --git a/kmp-nativecoroutines-compiler-embeddable/api/kmp-nativecoroutines-compiler-embeddable.api b/kmp-nativecoroutines-compiler-embeddable/api/kmp-nativecoroutines-compiler-embeddable.api
index 96f69365..76dad1b8 100644
--- a/kmp-nativecoroutines-compiler-embeddable/api/kmp-nativecoroutines-compiler-embeddable.api
+++ b/kmp-nativecoroutines-compiler-embeddable/api/kmp-nativecoroutines-compiler-embeddable.api
@@ -7,6 +7,7 @@ public final class com/rickclephas/kmp/nativecoroutines/compiler/KmpNativeCorout
public final class com/rickclephas/kmp/nativecoroutines/compiler/KmpNativeCoroutinesCompilerPluginRegistrar : org/jetbrains/kotlin/compiler/plugin/CompilerPluginRegistrar {
public fun ()V
+ public fun getPluginId ()Ljava/lang/String;
public fun getSupportsK2 ()Z
public fun registerExtensions (Lorg/jetbrains/kotlin/compiler/plugin/CompilerPluginRegistrar$ExtensionStorage;Lorg/jetbrains/kotlin/config/CompilerConfiguration;)V
}
@@ -104,6 +105,7 @@ public final class com/rickclephas/kmp/nativecoroutines/compiler/config/Suffixes
public final class com/rickclephas/kmp/nativecoroutines/compiler/config/SwiftExport : java/lang/Enum {
public static final field NO_FUNC_RETURN_TYPES Lcom/rickclephas/kmp/nativecoroutines/compiler/config/SwiftExport;
+ public static final field NO_THROWS_SUSPEND_FUNC Lcom/rickclephas/kmp/nativecoroutines/compiler/config/SwiftExport;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun valueOf (Ljava/lang/String;)Lcom/rickclephas/kmp/nativecoroutines/compiler/config/SwiftExport;
public static fun values ()[Lcom/rickclephas/kmp/nativecoroutines/compiler/config/SwiftExport;
diff --git a/kmp-nativecoroutines-compiler/api/kmp-nativecoroutines-compiler.api b/kmp-nativecoroutines-compiler/api/kmp-nativecoroutines-compiler.api
index 96f69365..76dad1b8 100644
--- a/kmp-nativecoroutines-compiler/api/kmp-nativecoroutines-compiler.api
+++ b/kmp-nativecoroutines-compiler/api/kmp-nativecoroutines-compiler.api
@@ -7,6 +7,7 @@ public final class com/rickclephas/kmp/nativecoroutines/compiler/KmpNativeCorout
public final class com/rickclephas/kmp/nativecoroutines/compiler/KmpNativeCoroutinesCompilerPluginRegistrar : org/jetbrains/kotlin/compiler/plugin/CompilerPluginRegistrar {
public fun ()V
+ public fun getPluginId ()Ljava/lang/String;
public fun getSupportsK2 ()Z
public fun registerExtensions (Lorg/jetbrains/kotlin/compiler/plugin/CompilerPluginRegistrar$ExtensionStorage;Lorg/jetbrains/kotlin/config/CompilerConfiguration;)V
}
@@ -104,6 +105,7 @@ public final class com/rickclephas/kmp/nativecoroutines/compiler/config/Suffixes
public final class com/rickclephas/kmp/nativecoroutines/compiler/config/SwiftExport : java/lang/Enum {
public static final field NO_FUNC_RETURN_TYPES Lcom/rickclephas/kmp/nativecoroutines/compiler/config/SwiftExport;
+ public static final field NO_THROWS_SUSPEND_FUNC Lcom/rickclephas/kmp/nativecoroutines/compiler/config/SwiftExport;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun valueOf (Ljava/lang/String;)Lcom/rickclephas/kmp/nativecoroutines/compiler/config/SwiftExport;
public static fun values ()[Lcom/rickclephas/kmp/nativecoroutines/compiler/config/SwiftExport;
diff --git a/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/KmpNativeCoroutinesCompilerPluginRegistrar.kt b/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/KmpNativeCoroutinesCompilerPluginRegistrar.kt
index 2cce4051..d3058499 100644
--- a/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/KmpNativeCoroutinesCompilerPluginRegistrar.kt
+++ b/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/KmpNativeCoroutinesCompilerPluginRegistrar.kt
@@ -13,6 +13,7 @@ import org.jetbrains.kotlin.fir.extensions.FirExtensionRegistrarAdapter
@OptIn(ExperimentalCompilerApi::class)
public class KmpNativeCoroutinesCompilerPluginRegistrar: CompilerPluginRegistrar() {
+ override val pluginId: String = "com.rickclephas.kmp.nativecoroutines"
override val supportsK2: Boolean = true
override fun ExtensionStorage.registerExtensions(configuration: CompilerConfiguration) {
diff --git a/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/config/SwiftExport.kt b/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/config/SwiftExport.kt
index 2c997aa5..dafd1d3c 100644
--- a/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/config/SwiftExport.kt
+++ b/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/config/SwiftExport.kt
@@ -4,6 +4,7 @@ import org.jetbrains.kotlin.utils.filterToSetOrEmpty
public enum class SwiftExport {
NO_FUNC_RETURN_TYPES,
+ NO_THROWS_SUSPEND_FUNC,
}
public val SWIFT_EXPORT: ConfigOptionWithDefault> =
diff --git a/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/fir/codegen/NativeFunction.kt b/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/fir/codegen/NativeFunction.kt
index 730eabb2..3882048b 100644
--- a/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/fir/codegen/NativeFunction.kt
+++ b/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/fir/codegen/NativeFunction.kt
@@ -84,7 +84,10 @@ internal fun FirExtension.buildNativeFunction(
if (annotation.shouldRefineInSwift) {
annotations.add(buildAnnotation(ClassIds.shouldRefineInSwift))
}
- if (SwiftExport.NO_FUNC_RETURN_TYPES in swiftExport && callableSignature.isSuspend) {
+ if (SwiftExport.NO_FUNC_RETURN_TYPES in swiftExport &&
+ SwiftExport.NO_THROWS_SUSPEND_FUNC !in swiftExport &&
+ callableSignature.isSuspend
+ ) {
annotations.add(buildThrowsAnnotation(ClassIds.exception))
}
diff --git a/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/fir/extensions/KmpNativeCoroutinesDeclarationGenerationExtension.kt b/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/fir/extensions/KmpNativeCoroutinesDeclarationGenerationExtension.kt
index 9fbb18fb..a981ddb6 100644
--- a/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/fir/extensions/KmpNativeCoroutinesDeclarationGenerationExtension.kt
+++ b/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/fir/extensions/KmpNativeCoroutinesDeclarationGenerationExtension.kt
@@ -5,6 +5,7 @@ import com.rickclephas.kmp.nativecoroutines.compiler.fir.codegen.buildNativeFunc
import com.rickclephas.kmp.nativecoroutines.compiler.fir.codegen.buildNativeProperty
import com.rickclephas.kmp.nativecoroutines.compiler.fir.codegen.buildSharedFlowReplayCacheProperty
import com.rickclephas.kmp.nativecoroutines.compiler.fir.codegen.buildStateFlowValueProperty
+import com.rickclephas.kmp.nativecoroutines.compiler.utils.FqNames
import com.rickclephas.kmp.nativecoroutines.compiler.utils.NativeCoroutinesAnnotation
import com.rickclephas.kmp.nativecoroutines.compiler.utils.NativeCoroutinesAnnotation.NativeCoroutines
import com.rickclephas.kmp.nativecoroutines.compiler.utils.NativeCoroutinesAnnotation.NativeCoroutinesIgnore
@@ -19,6 +20,7 @@ import org.jetbrains.kotlin.fir.FirSession
import org.jetbrains.kotlin.fir.declarations.DirectDeclarationsAccess
import org.jetbrains.kotlin.fir.declarations.utils.isExpect
import org.jetbrains.kotlin.fir.extensions.*
+import org.jetbrains.kotlin.fir.extensions.predicate.DeclarationPredicate
import org.jetbrains.kotlin.fir.extensions.predicate.LookupPredicate
import org.jetbrains.kotlin.fir.resolve.providers.symbolProvider
import org.jetbrains.kotlin.fir.scopes.getFunctions
@@ -41,9 +43,13 @@ internal class KmpNativeCoroutinesDeclarationGenerationExtension(
private val lookupPredicate = LookupPredicate.AnnotatedWith(
NativeCoroutinesAnnotation.entries.map { it.fqName }.toSet()
)
+ private val objcExportPredicate = DeclarationPredicate.AnnotatedWith(
+ setOf(FqNames.nativeCoroutinesObjCExport)
+ )
override fun FirDeclarationPredicateRegistrar.registerPredicates() {
register(lookupPredicate)
+ register(objcExportPredicate)
}
override fun getCallableNamesForClass(
@@ -102,6 +108,7 @@ internal class KmpNativeCoroutinesDeclarationGenerationExtension(
private fun getAnnotationForSymbol(symbol: FirCallableSymbol<*>): NativeCoroutinesAnnotation? {
if (symbol.rawStatus.isOverride || symbol.isExpect) return null
+ if (swiftExport.isNotEmpty() && session.predicateBasedProvider.matches(objcExportPredicate, symbol)) return null
return predicates.entries.singleOrNull { (_, predicate) ->
session.predicateBasedProvider.matches(predicate, symbol)
}?.key
diff --git a/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/utils/FqNames.kt b/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/utils/FqNames.kt
index de95db53..77bcbc3a 100644
--- a/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/utils/FqNames.kt
+++ b/kmp-nativecoroutines-compiler/src/main/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/utils/FqNames.kt
@@ -26,4 +26,6 @@ internal object FqNames {
val observableViewModel = FqName("com.rickclephas.kmp.observableviewmodel.ViewModel")
val androidxViewModel = FqName("androidx.lifecycle.ViewModel")
+
+ val nativeCoroutinesObjCExport = FqName("com.rickclephas.kmp.nativecoroutines.sample.NativeCoroutinesObjCExport")
}
diff --git a/kmp-nativecoroutines-compiler/src/test/generated/com/rickclephas/kmp/nativecoroutines/compiler/runners/FirLightTreeCodegenTestGenerated.java b/kmp-nativecoroutines-compiler/src/test/generated/com/rickclephas/kmp/nativecoroutines/compiler/runners/FirLightTreeCodegenTestGenerated.java
index 7a966a88..981ac517 100644
--- a/kmp-nativecoroutines-compiler/src/test/generated/com/rickclephas/kmp/nativecoroutines/compiler/runners/FirLightTreeCodegenTestGenerated.java
+++ b/kmp-nativecoroutines-compiler/src/test/generated/com/rickclephas/kmp/nativecoroutines/compiler/runners/FirLightTreeCodegenTestGenerated.java
@@ -4,7 +4,6 @@
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
-import org.jetbrains.kotlin.test.TargetBackend;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
@@ -19,7 +18,7 @@
public class FirLightTreeCodegenTestGenerated extends AbstractFirLightTreeCodegenTest {
@Test
public void testAllFilesPresentInCodegen() {
- KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("src/testData/codegen"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kt$"), TargetBackend.JVM_IR, true);
+ KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("src/testData/codegen"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kt$"), true);
}
@Test
@@ -58,7 +57,7 @@ public void testViewmodelscope() {
public class Swift1 {
@Test
public void testAllFilesPresentInSwift1() {
- KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("src/testData/codegen/swift1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kt$"), TargetBackend.JVM_IR, true);
+ KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("src/testData/codegen/swift1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kt$"), true);
}
@Test
@@ -91,4 +90,44 @@ public void testViewmodelscope() {
runTest("src/testData/codegen/swift1/viewmodelscope.kt");
}
}
+
+ @Nested
+ @TestMetadata("src/testData/codegen/swift3")
+ @TestDataPath("$PROJECT_ROOT")
+ public class Swift3 {
+ @Test
+ public void testAllFilesPresentInSwift3() {
+ KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("src/testData/codegen/swift3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kt$"), true);
+ }
+
+ @Test
+ @TestMetadata("annotations.kt")
+ public void testAnnotations() {
+ runTest("src/testData/codegen/swift3/annotations.kt");
+ }
+
+ @Test
+ @TestMetadata("coroutinescope.kt")
+ public void testCoroutinescope() {
+ runTest("src/testData/codegen/swift3/coroutinescope.kt");
+ }
+
+ @Test
+ @TestMetadata("functions.kt")
+ public void testFunctions() {
+ runTest("src/testData/codegen/swift3/functions.kt");
+ }
+
+ @Test
+ @TestMetadata("properties.kt")
+ public void testProperties() {
+ runTest("src/testData/codegen/swift3/properties.kt");
+ }
+
+ @Test
+ @TestMetadata("viewmodelscope.kt")
+ public void testViewmodelscope() {
+ runTest("src/testData/codegen/swift3/viewmodelscope.kt");
+ }
+ }
}
diff --git a/kmp-nativecoroutines-compiler/src/test/generated/com/rickclephas/kmp/nativecoroutines/compiler/runners/FirPsiCodegenTestGenerated.java b/kmp-nativecoroutines-compiler/src/test/generated/com/rickclephas/kmp/nativecoroutines/compiler/runners/FirPsiCodegenTestGenerated.java
index b5f8019e..b507b3db 100644
--- a/kmp-nativecoroutines-compiler/src/test/generated/com/rickclephas/kmp/nativecoroutines/compiler/runners/FirPsiCodegenTestGenerated.java
+++ b/kmp-nativecoroutines-compiler/src/test/generated/com/rickclephas/kmp/nativecoroutines/compiler/runners/FirPsiCodegenTestGenerated.java
@@ -4,7 +4,6 @@
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.kotlin.test.util.KtTestUtil;
-import org.jetbrains.kotlin.test.TargetBackend;
import org.jetbrains.kotlin.test.TestMetadata;
import org.junit.jupiter.api.Nested;
import org.junit.jupiter.api.Test;
@@ -19,7 +18,7 @@
public class FirPsiCodegenTestGenerated extends AbstractFirPsiCodegenTest {
@Test
public void testAllFilesPresentInCodegen() {
- KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("src/testData/codegen"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kt$"), TargetBackend.JVM_IR, true);
+ KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("src/testData/codegen"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kt$"), true);
}
@Test
@@ -58,7 +57,7 @@ public void testViewmodelscope() {
public class Swift1 {
@Test
public void testAllFilesPresentInSwift1() {
- KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("src/testData/codegen/swift1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kt$"), TargetBackend.JVM_IR, true);
+ KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("src/testData/codegen/swift1"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kt$"), true);
}
@Test
@@ -91,4 +90,44 @@ public void testViewmodelscope() {
runTest("src/testData/codegen/swift1/viewmodelscope.kt");
}
}
+
+ @Nested
+ @TestMetadata("src/testData/codegen/swift3")
+ @TestDataPath("$PROJECT_ROOT")
+ public class Swift3 {
+ @Test
+ public void testAllFilesPresentInSwift3() {
+ KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("src/testData/codegen/swift3"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kt$"), true);
+ }
+
+ @Test
+ @TestMetadata("annotations.kt")
+ public void testAnnotations() {
+ runTest("src/testData/codegen/swift3/annotations.kt");
+ }
+
+ @Test
+ @TestMetadata("coroutinescope.kt")
+ public void testCoroutinescope() {
+ runTest("src/testData/codegen/swift3/coroutinescope.kt");
+ }
+
+ @Test
+ @TestMetadata("functions.kt")
+ public void testFunctions() {
+ runTest("src/testData/codegen/swift3/functions.kt");
+ }
+
+ @Test
+ @TestMetadata("properties.kt")
+ public void testProperties() {
+ runTest("src/testData/codegen/swift3/properties.kt");
+ }
+
+ @Test
+ @TestMetadata("viewmodelscope.kt")
+ public void testViewmodelscope() {
+ runTest("src/testData/codegen/swift3/viewmodelscope.kt");
+ }
+ }
}
diff --git a/kmp-nativecoroutines-compiler/src/test/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/GenerateTests.kt b/kmp-nativecoroutines-compiler/src/test/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/GenerateTests.kt
index 90b75af5..a326d52b 100644
--- a/kmp-nativecoroutines-compiler/src/test/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/GenerateTests.kt
+++ b/kmp-nativecoroutines-compiler/src/test/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/GenerateTests.kt
@@ -1,7 +1,7 @@
package com.rickclephas.kmp.nativecoroutines.compiler
import com.rickclephas.kmp.nativecoroutines.compiler.runners.*
-import org.jetbrains.kotlin.generators.generateTestGroupSuiteWithJUnit5
+import org.jetbrains.kotlin.generators.dsl.junit5.generateTestGroupSuiteWithJUnit5
fun main() {
generateTestGroupSuiteWithJUnit5 {
diff --git a/kmp-nativecoroutines-compiler/src/test/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/runners/AbstractFirBaseCodegenTest.kt b/kmp-nativecoroutines-compiler/src/test/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/runners/AbstractFirBaseCodegenTest.kt
index 72dbcd53..eef1ce14 100644
--- a/kmp-nativecoroutines-compiler/src/test/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/runners/AbstractFirBaseCodegenTest.kt
+++ b/kmp-nativecoroutines-compiler/src/test/kotlin/com/rickclephas/kmp/nativecoroutines/compiler/runners/AbstractFirBaseCodegenTest.kt
@@ -81,7 +81,8 @@ abstract class AbstractFirBaseCodegenTest(
KmpNativeCoroutinesDirectives.STATE_FLOW_SUFFIX with "Flow"
}
listOf(
- 0b1, // Kotlin 2.2.21
+ 0b01, // Kotlin 2.2.21
+ 0b11, // Kotlin 2.3.0-Beta2
).forEach { version ->
forTestsMatching("swift$version/*") {
defaultDirectives {
diff --git a/kmp-nativecoroutines-compiler/src/testData/codegen/annotations.fir.ir.txt b/kmp-nativecoroutines-compiler/src/testData/codegen/annotations.fir.ir.txt
index b4eeb1b4..3ba6e92b 100644
--- a/kmp-nativecoroutines-compiler/src/testData/codegen/annotations.fir.ir.txt
+++ b/kmp-nativecoroutines-compiler/src/testData/codegen/annotations.fir.ir.txt
@@ -1,241 +1,4 @@
-FILE fqName: fileName:/annotations.kt
- annotations:
- Suppress(names = ["OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE"] type=kotlin.Array varargElementType=kotlin.String)
- PROPERTY name:deprecatedProperty1 visibility:public modality:FINAL [val]
- annotations:
- NativeCoroutines
- Deprecated(message = "This is deprecated 4", replaceWith = , level = )
- FIELD PROPERTY_BACKING_FIELD name:deprecatedProperty1 type:kotlinx.coroutines.flow.Flow visibility:private [final,static]
- EXPRESSION_BODY
- CALL 'public final fun flowOf (value: T of kotlinx.coroutines.flow.flowOf): kotlinx.coroutines.flow.Flow declared in kotlinx.coroutines.flow' type=kotlinx.coroutines.flow.Flow origin=null
- TYPE_ARG T: kotlin.String
- ARG value: CONST String type=kotlin.String value="OK4"
- FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL returnType:kotlinx.coroutines.flow.Flow
- correspondingProperty: PROPERTY name:deprecatedProperty1 visibility:public modality:FINAL [val]
- BLOCK_BODY
- RETURN type=kotlin.Nothing from='public final fun (): kotlinx.coroutines.flow.Flow declared in '
- GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:deprecatedProperty1 type:kotlinx.coroutines.flow.Flow visibility:private [final,static]' type=kotlinx.coroutines.flow.Flow origin=null
- PROPERTY name:deprecatedProperty2 visibility:public modality:FINAL [val]
- annotations:
- NativeCoroutines
- Deprecated(message = "This is deprecated 5", replaceWith = , level = GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:WARNING' type=kotlin.DeprecationLevel)
- FIELD PROPERTY_BACKING_FIELD name:deprecatedProperty2 type:kotlinx.coroutines.flow.Flow visibility:private [final,static]
- EXPRESSION_BODY
- CALL 'public final fun flowOf (value: T of kotlinx.coroutines.flow.flowOf): kotlinx.coroutines.flow.Flow declared in kotlinx.coroutines.flow' type=kotlinx.coroutines.flow.Flow origin=null
- TYPE_ARG T: kotlin.String
- ARG value: CONST String type=kotlin.String value="OK5"
- FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL returnType:kotlinx.coroutines.flow.Flow
- correspondingProperty: PROPERTY name:deprecatedProperty2 visibility:public modality:FINAL [val]
- BLOCK_BODY
- RETURN type=kotlin.Nothing from='public final fun (): kotlinx.coroutines.flow.Flow declared in '
- GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:deprecatedProperty2 type:kotlinx.coroutines.flow.Flow visibility:private [final,static]' type=kotlinx.coroutines.flow.Flow origin=null
- PROPERTY name:deprecatedProperty3 visibility:public modality:FINAL [val]
- annotations:
- NativeCoroutines
- Deprecated(message = "This is deprecated 6", replaceWith = ReplaceWith(expression = "deprecatedProperty2", imports = [] type=kotlin.Array varargElementType=kotlin.String), level = GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:ERROR' type=kotlin.DeprecationLevel)
- FIELD PROPERTY_BACKING_FIELD name:deprecatedProperty3 type:kotlinx.coroutines.flow.Flow visibility:private [final,static]
- EXPRESSION_BODY
- CALL 'public final fun flowOf (value: T of kotlinx.coroutines.flow.flowOf): kotlinx.coroutines.flow.Flow declared in kotlinx.coroutines.flow' type=kotlinx.coroutines.flow.Flow origin=null
- TYPE_ARG T: kotlin.String
- ARG value: CONST String type=kotlin.String value="OK6"
- FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL returnType:kotlinx.coroutines.flow.Flow
- correspondingProperty: PROPERTY name:deprecatedProperty3 visibility:public modality:FINAL [val]
- BLOCK_BODY
- RETURN type=kotlin.Nothing from='public final fun (): kotlinx.coroutines.flow.Flow declared in '
- GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:deprecatedProperty3 type:kotlinx.coroutines.flow.Flow visibility:private [final,static]' type=kotlinx.coroutines.flow.Flow origin=null
- PROPERTY name:deprecatedProperty4 visibility:public modality:FINAL [val]
- annotations:
- NativeCoroutines
- FIELD PROPERTY_BACKING_FIELD name:deprecatedProperty4 type:kotlinx.coroutines.flow.MutableStateFlow visibility:private [final,static]
- EXPRESSION_BODY
- CALL 'public final fun MutableStateFlow (value: T of kotlinx.coroutines.flow.MutableStateFlow): kotlinx.coroutines.flow.MutableStateFlow declared in kotlinx.coroutines.flow' type=kotlinx.coroutines.flow.MutableStateFlow origin=null
- TYPE_ARG T: kotlin.String
- ARG value: CONST String type=kotlin.String value="OK7"
- FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL returnType:kotlinx.coroutines.flow.MutableStateFlow
- annotations:
- Deprecated(message = "This is deprecated 7", replaceWith = , level = )
- correspondingProperty: PROPERTY name:deprecatedProperty4 visibility:public modality:FINAL [val]
- BLOCK_BODY
- RETURN type=kotlin.Nothing from='public final fun (): kotlinx.coroutines.flow.MutableStateFlow declared in '
- GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:deprecatedProperty4 type:kotlinx.coroutines.flow.MutableStateFlow visibility:private [final,static]' type=kotlinx.coroutines.flow.MutableStateFlow origin=null
- PROPERTY name:objCNameProperty1 visibility:public modality:FINAL [val]
- annotations:
- NativeCoroutines
- OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalObjCName modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass] type=kotlin.Array> varargElementType=kotlin.reflect.KClass)
- ObjCName(name = "objCNameProperty1ObjC", swiftName = , exact = )
- FIELD PROPERTY_BACKING_FIELD name:objCNameProperty1 type:kotlinx.coroutines.flow.StateFlow visibility:private [final,static]
- EXPRESSION_BODY
- CALL 'public final fun MutableStateFlow (value: T of kotlinx.coroutines.flow.MutableStateFlow): kotlinx.coroutines.flow.MutableStateFlow declared in kotlinx.coroutines.flow' type=kotlinx.coroutines.flow.MutableStateFlow origin=null
- TYPE_ARG T: kotlin.String
- ARG value: CONST String type=kotlin.String value="OK11"
- FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL returnType:kotlinx.coroutines.flow.StateFlow
- correspondingProperty: PROPERTY name:objCNameProperty1 visibility:public modality:FINAL [val]
- BLOCK_BODY
- RETURN type=kotlin.Nothing from='public final fun (): kotlinx.coroutines.flow.StateFlow declared in '
- GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:objCNameProperty1 type:kotlinx.coroutines.flow.StateFlow visibility:private [final,static]' type=kotlinx.coroutines.flow.StateFlow origin=null
- PROPERTY name:objCNameProperty2 visibility:public modality:FINAL [val]
- annotations:
- NativeCoroutinesState
- OptIn(markerClass = [CLASS_REFERENCE 'CLASS IR_EXTERNAL_DECLARATION_STUB ANNOTATION_CLASS name:ExperimentalObjCName modality:OPEN visibility:public superTypes:[kotlin.Annotation]' type=kotlin.reflect.KClass] type=kotlin.Array> varargElementType=kotlin.reflect.KClass)
- ObjCName(name = "objCNameProperty2ObjC", swiftName = , exact = )
- FIELD PROPERTY_BACKING_FIELD name:objCNameProperty2 type:kotlinx.coroutines.flow.StateFlow visibility:private [final,static]
- EXPRESSION_BODY
- CALL 'public final fun MutableStateFlow (value: T of kotlinx.coroutines.flow.MutableStateFlow): kotlinx.coroutines.flow.MutableStateFlow declared in kotlinx.coroutines.flow' type=kotlinx.coroutines.flow.MutableStateFlow origin=null
- TYPE_ARG T: kotlin.String
- ARG value: CONST String type=kotlin.String value="OK12"
- FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL returnType:kotlinx.coroutines.flow.StateFlow
- correspondingProperty: PROPERTY name:objCNameProperty2 visibility:public modality:FINAL [val]
- BLOCK_BODY
- RETURN type=kotlin.Nothing from='public final fun (): kotlinx.coroutines.flow.StateFlow declared in '
- GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:objCNameProperty2 type:kotlinx.coroutines.flow.StateFlow visibility:private [final,static]' type=kotlinx.coroutines.flow.StateFlow origin=null
- FUN name:box visibility:public modality:FINAL returnType:kotlin.String
- BLOCK_BODY
- RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in '
- CALL 'public final fun runBoxTest (action: @[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1): kotlin.String declared in com.rickclephas.kmp.nativecoroutines' type=kotlin.String origin=null
- ARG action: FUN_EXPR type=@[ExtensionFunctionType] kotlin.coroutines.SuspendFunction1 origin=LAMBDA
- FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL returnType:kotlin.Unit [suspend]
- VALUE_PARAMETER kind:ExtensionReceiver name:$this$runBoxTest index:0 type:com.rickclephas.kmp.nativecoroutines.BoxTest
- BLOCK_BODY
- CALL 'public final fun await (nativeSuspend: kotlin.Function0, @[ParameterName(name = "onError")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0>>): kotlin.Unit declared in com.rickclephas.kmp.nativecoroutines.BoxTest' type=kotlin.Unit origin=null
- TYPE_ARG T: kotlin.String
- ARG : GET_VAR '$this$runBoxTest: com.rickclephas.kmp.nativecoroutines.BoxTest declared in .box.' type=com.rickclephas.kmp.nativecoroutines.BoxTest origin=IMPLICIT_ARGUMENT
- ARG nativeSuspend: FUN_EXPR type=kotlin.Function0, @[ParameterName(name = "onError")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0>> origin=LAMBDA
- FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL returnType:kotlin.Function3<@[ParameterName(name = "onResult")] kotlin.Function2, @[ParameterName(name = "onError")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0>
- BLOCK_BODY
- RETURN type=kotlin.Nothing from='local final fun (): kotlin.Function3<@[ParameterName(name = "onResult")] kotlin.Function2, @[ParameterName(name = "onError")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0> declared in .box.'
- CALL 'public final fun deprecatedFunction1Native (): kotlin.Function3<@[ParameterName(name = "onResult")] kotlin.Function2, @[ParameterName(name = "onError")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0> declared in ' type=kotlin.Function3<@[ParameterName(name = "onResult")] kotlin.Function2, @[ParameterName(name = "onError")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0> origin=null
- CALL 'public final fun await (nativeSuspend: kotlin.Function0, @[ParameterName(name = "onError")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0>>): kotlin.Unit declared in com.rickclephas.kmp.nativecoroutines.BoxTest' type=kotlin.Unit origin=null
- TYPE_ARG T: kotlin.String
- ARG : GET_VAR '$this$runBoxTest: com.rickclephas.kmp.nativecoroutines.BoxTest declared in .box.' type=com.rickclephas.kmp.nativecoroutines.BoxTest origin=IMPLICIT_ARGUMENT
- ARG nativeSuspend: FUN_EXPR type=kotlin.Function0, @[ParameterName(name = "onError")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0>> origin=LAMBDA
- FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL returnType:kotlin.Function3<@[ParameterName(name = "onResult")] kotlin.Function2, @[ParameterName(name = "onError")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0>
- BLOCK_BODY
- RETURN type=kotlin.Nothing from='local final fun (): kotlin.Function3<@[ParameterName(name = "onResult")] kotlin.Function2, @[ParameterName(name = "onError")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0> declared in .box.'
- CALL 'public final fun deprecatedFunction2Native (): kotlin.Function3<@[ParameterName(name = "onResult")] kotlin.Function2, @[ParameterName(name = "onError")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0> declared in ' type=kotlin.Function3<@[ParameterName(name = "onResult")] kotlin.Function2, @[ParameterName(name = "onError")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0> origin=null
- CALL 'public final fun collect (nativeFlow: kotlin.Function3<@[ParameterName(name = "onItem")] kotlin.Function3, kotlin.Unit, kotlin.Unit>, @[ParameterName(name = "onComplete")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0>, maxValues: kotlin.Int?): kotlin.Unit declared in com.rickclephas.kmp.nativecoroutines.BoxTest' type=kotlin.Unit origin=null
- TYPE_ARG T: kotlin.String
- ARG : GET_VAR '$this$runBoxTest: com.rickclephas.kmp.nativecoroutines.BoxTest declared in .box.' type=com.rickclephas.kmp.nativecoroutines.BoxTest origin=IMPLICIT_ARGUMENT
- ARG nativeFlow: CALL 'public final fun (): kotlin.Function3<@[ParameterName(name = "onItem")] kotlin.Function3, kotlin.Unit, kotlin.Unit>, @[ParameterName(name = "onComplete")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0> declared in ' type=kotlin.Function3<@[ParameterName(name = "onItem")] kotlin.Function3, kotlin.Unit, kotlin.Unit>, @[ParameterName(name = "onComplete")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0> origin=GET_PROPERTY
- CALL 'public final fun collect (nativeFlow: kotlin.Function3<@[ParameterName(name = "onItem")] kotlin.Function3, kotlin.Unit, kotlin.Unit>, @[ParameterName(name = "onComplete")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0>, maxValues: kotlin.Int?): kotlin.Unit declared in com.rickclephas.kmp.nativecoroutines.BoxTest' type=kotlin.Unit origin=null
- TYPE_ARG T: kotlin.String
- ARG : GET_VAR '$this$runBoxTest: com.rickclephas.kmp.nativecoroutines.BoxTest declared in .box.' type=com.rickclephas.kmp.nativecoroutines.BoxTest origin=IMPLICIT_ARGUMENT
- ARG nativeFlow: CALL 'public final fun (): kotlin.Function3<@[ParameterName(name = "onItem")] kotlin.Function3, kotlin.Unit, kotlin.Unit>, @[ParameterName(name = "onComplete")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0> declared in ' type=kotlin.Function3<@[ParameterName(name = "onItem")] kotlin.Function3, kotlin.Unit, kotlin.Unit>, @[ParameterName(name = "onComplete")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0> origin=GET_PROPERTY
- CALL 'public final fun collect (nativeFlow: kotlin.Function3<@[ParameterName(name = "onItem")] kotlin.Function3, kotlin.Unit, kotlin.Unit>, @[ParameterName(name = "onComplete")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0>, maxValues: kotlin.Int?): kotlin.Unit declared in com.rickclephas.kmp.nativecoroutines.BoxTest' type=kotlin.Unit origin=null
- TYPE_ARG T: kotlin.String
- ARG : GET_VAR '$this$runBoxTest: com.rickclephas.kmp.nativecoroutines.BoxTest declared in .box.' type=com.rickclephas.kmp.nativecoroutines.BoxTest origin=IMPLICIT_ARGUMENT
- ARG nativeFlow: CALL 'public final fun (): kotlin.Function3<@[ParameterName(name = "onItem")] kotlin.Function3, kotlin.Unit, kotlin.Unit>, @[ParameterName(name = "onComplete")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0> declared in ' type=kotlin.Function3<@[ParameterName(name = "onItem")] kotlin.Function3, kotlin.Unit, kotlin.Unit>, @[ParameterName(name = "onComplete")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0> origin=GET_PROPERTY
- ARG maxValues: CONST Int type=kotlin.Int value=1
- CALL 'public final fun value (value: T of com.rickclephas.kmp.nativecoroutines.BoxTest.value): kotlin.Unit declared in com.rickclephas.kmp.nativecoroutines.BoxTest' type=kotlin.Unit origin=null
- TYPE_ARG T: kotlin.String
- ARG : GET_VAR '$this$runBoxTest: com.rickclephas.kmp.nativecoroutines.BoxTest declared in .box.' type=com.rickclephas.kmp.nativecoroutines.BoxTest origin=IMPLICIT_ARGUMENT
- ARG value: CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=GET_PROPERTY
- CALL 'public final fun await (nativeSuspend: kotlin.Function0, @[ParameterName(name = "onError")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0>>): kotlin.Unit declared in com.rickclephas.kmp.nativecoroutines.BoxTest' type=kotlin.Unit origin=null
- TYPE_ARG T: kotlin.String
- ARG : GET_VAR '$this$runBoxTest: com.rickclephas.kmp.nativecoroutines.BoxTest declared in .box.' type=com.rickclephas.kmp.nativecoroutines.BoxTest origin=IMPLICIT_ARGUMENT
- ARG nativeSuspend: FUN_EXPR type=kotlin.Function0, @[ParameterName(name = "onError")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0>> origin=LAMBDA
- FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL returnType:kotlin.Function3<@[ParameterName(name = "onResult")] kotlin.Function2, @[ParameterName(name = "onError")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2, kotlin.Function0>
- BLOCK_BODY
- RETURN type=kotlin.Nothing from='local final fun (): kotlin.Function3<@[ParameterName(name = "onResult")] kotlin.Function2, @[ParameterName(name = "onError")] kotlin.Function2, @[ParameterName(name = "onCancelled")] kotlin.Function2