Guilherme Delgado
10/16/2025, 4:22 PMfun suspendFlowFunction(): Flow<String> will create a public static func suspendFlowFunction() -> any ExportedKotlinPackages.kotlinx.coroutines.flow.Flow which loses its type (all generics are being transform into (*any* KotlinRuntimeSupport._KotlinBridgeable)?). So, if I need to type check, either I force cast in Swift or I’ll have to create a fun suspendFlowFunction(callback: (String) -> Unit) so that swiftExport translates to public static func suspendFlowFunction(callback: @escaping (Swift.String) -> Swift.Void) , but then it will make me collect the values inside Kotlin instead of Swift, am I correct? I know this is still in developing 😊 , just to check.Artem Olkov
10/17/2025, 7:03 AMInterop with: Flow<String>
Flow is not designed and should be considered supported 🙂 If it works somehow on your side it's a coincidence, and it will be heavily reworked in the future.
But yeah, if you want to write a "collect" method wrapper(so that you get some type-safety) - you should call the original collect inside that wrapper.Guilherme Delgado
10/17/2025, 7:31 AMArtem Olkov
10/17/2025, 7:52 AMbut a List failsYes, Lists(collections in general) are a special, same way as Strings, Closures and Primitives. We are currently focusing on coroutines support in general, so I don't have a timeline for you, when this quirk of the type system will be fixed(or if it's even fixable) 🙂
Guilherme Delgado
10/27/2025, 5:15 PMsuspend fun observeListOfMyClass(callback: (List<MyClass>) -> Unit) {...}
public func observeListOfMyClass(
callback: @escaping (Swift.Array<Swift.Never>) -> Swift.Void
) async -> Swift.Void {
fatalError()
}
I guess even with callbacks, List<T> is out of the question for now 😅 , am I correct?Guilherme Delgado
10/27/2025, 5:28 PMpublic static func suspendFlowFunctionSpawn2(
callback: @escaping (Swift.Array<ExportedKotlinPackages.com.playground.DataClass>) -> Swift.Void
) -> Swift.Void {
return com_playground_suspendFlowFunctionSpawn2__TypesOfArguments__U28Swift_Array_ExportedKotlinPackages_com_playground_DataClass_U29202D_U20Swift_Void__({
let originalBlock = callback
return { arg0 in return originalBlock(arg0 as! Swift.Array<ExportedKotlinPackages.com.playground.DataClass>) }
}())
}Guilherme Delgado
10/27/2025, 5:33 PM