Javier
09/24/2025, 10:59 AMJohn O'Reilly
09/24/2025, 11:04 AMjw
09/24/2025, 1:05 PMjw
09/24/2025, 1:05 PMJavier
09/24/2025, 1:28 PMjw
09/24/2025, 1:29 PMJavier
09/24/2025, 1:30 PMJavier
09/24/2025, 9:49 PMJohn O'Reilly
09/25/2025, 7:34 AMiosSimulatorArm64/Debug/Sources/Shared/Shared.swift:347:26 contextual closure type '() -> Void' expects 0 arguments, but 1 was used in closure bodyGuilherme Delgado
09/25/2025, 9:16 AM-5897 - 9111 was failing -, and I don’t see async functions being generated, example:
suspend fun testSuspendFunction(): String {
return "Hello from suspend function"
}
suspend fun testSuspendFunction2(): Flow<String> {
return flow { "Hello from suspend function" }
}
are ignored.Guilherme Delgado
09/25/2025, 9:36 AM9149 they are generated:
public static func testSuspendFunction() async -> Swift.String {
await withUnsafeContinuation { nativeContinuation in
let continuation: (Swift.String) -> Swift.Void = { nativeContinuation.resume(returning: $0) }
let _: () = com_sample_models_testSuspendFunction({
let originalBlock = continuation
return { arg0 in return originalBlock(arg0) }
}())
}
}
public static func testSuspendFunction2() async -> any ExportedKotlinPackages.kotlinx.coroutines.flow.Flow {
await withUnsafeContinuation { nativeContinuation in
let continuation: (any ExportedKotlinPackages.kotlinx.coroutines.flow.Flow) -> Swift.Void = { nativeContinuation.resume(returning: $0) }
let _: () = com_sample_models_testSuspendFunction2({
let originalBlock = continuation
return { arg0 in return originalBlock(KotlinRuntime.KotlinBase.__createProtocolWrapper(externalRCRef: arg0) as! any ExportedKotlinPackages.kotlinx.coroutines.flow.Flow) }
}())
}
}Guilherme Delgado
09/25/2025, 9:39 AMJavier
09/25/2025, 1:04 PMJavier
09/25/2025, 1:05 PMJohn O'Reilly
09/25/2025, 5:24 PM2.3.0-dev-9149 and still seeing error above. Using Xcode 26 and Swift 6.John O'Reilly
09/25/2025, 7:15 PMJavier
09/25/2025, 7:19 PMI think you need to change the base branch?\This branch is 161 commits ahead of, 2 commits behind cbeust/chip-8:master
John O'Reilly
09/25/2025, 7:20 PMJohn O'Reilly
09/25/2025, 7:21 PMJohn O'Reilly
09/25/2025, 7:23 PMcontextual closure type '() -> Void' expects 0 arguments, but 1 was used in closure body error ....but I might have missed something I need to updateGuilherme Delgado
09/26/2025, 9:30 AMGuilherme Delgado
09/26/2025, 9:31 AMJohn O'Reilly
09/26/2025, 3:59 PMGuilherme Delgado
09/26/2025, 5:23 PMGuilherme Delgado
09/26/2025, 5:23 PMArtem Olkov
10/08/2025, 11:08 AMGuilherme Delgado
10/08/2025, 11:14 AM2.3.0-Beta1 has that flag enabled by default — I was testing it a moment ago and everything built successfully, but the coroutines code got ignored 😅 Thanks for the heads-up!Artem Olkov
10/08/2025, 11:14 AMGuilherme Delgado
10/08/2025, 11:16 AMsuspend fun testSuspendFunction(): String {
return "Hello from suspend function"
}
suspend fun testSuspendFunction2(): Flow<String> {
return flow { "Hello from suspend function" }
}
But anyway, nice to have that flag 🙂Artem Olkov
10/09/2025, 11:58 AMcontextual closure type '() -> Void' expects 0 arguments, but 1 was used in closure body
KT-81593 Swift Export: suspend function returning Unit leads to incompilable code
We have discovered the root cause for that error. Thanks for the report!Javier
10/27/2025, 9:09 AMArtem Olkov
10/27/2025, 9:10 AMSomething new around Flow?Currently we do not work towards supporting
Flow, all current work is dedicated to supporting actual suspend functions.Javier
10/29/2025, 12:57 PMArtem Olkov
10/29/2025, 1:34 PMis creating callbacks in Kotlin to consume them on SwiftNope, producing functional types from kotlin into swift is also not supported, only the other way around 🙂
Artem Olkov
10/29/2025, 2:03 PMJavier
10/29/2025, 2:24 PMArtem Olkov
10/29/2025, 3:07 PM