-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flow extension functions not fully supported #9
Comments
I wasn't able to reproduce the issue locally. What version of SKIE, Kotlin, and Xcode do you use? |
SKIE: 0.4.20 Removing that extension function makes the error go away, so it seems to be really caused by this line. We can do a screensharing session if it helps. Unfortunately the project itself isn't open source. |
I was able to reproduce the issue by disabling Flow support for the suspend function. Do you also have the the flows disabled? (probably in the Gradle config) |
It is enabled, but only for my shared module. Just an idea: the public sealed class Resultat<out T> Could it be that because that sealed class isn't treated by the SKIE gradle plugin the compilation issue caused? |
Hm, no, enabling SKIE enum and sealed class handling and/or flow/suspend handling for the |
This is what SKIE generates: public extension __Skie.file__Project_shared__ResultatFlowExtensionsKt {
@available(iOS 13, macOS 10.15, watchOS 6, tvOS 13, * )
static func firstAfterLoading(_ this: __Skie.swift__SkieSwiftFlow<__Skie.class__fr_haan_resultat_resultat__fr_haan_resultat_Resultat<Swift.AnyObject>>) async throws -> __Skie.class__fr_haan_resultat_resultat__fr_haan_resultat_Resultat<Swift.AnyObject> {
return try await SwiftCoroutineDispatcher.dispatch {
__Skie.file__shared____SkieSuspendWrappersKt.Skie_Suspend__1__firstAfterLoading(extensionReceiver:suspendHandler:)(this, $0)
}
}
} |
And is the The generated code is the same as the one I got. What I think causes the problem is that the |
Yes, |
Ok, we need to look at the content of the apinotes file. In the skie build directory (the one that contains the In that file, there should be an entry for the generated function (search for |
Yes, indeed, there is a selector: - Selector: "Skie_Suspend__1__firstAfterLoadingExtensionReceiver:suspendHandler:"
MethodKind: "Class"
SwiftName: "Skie_Suspend__1__firstAfterLoading(extensionReceiver:suspendHandler:)"
SwiftPrivate: true
ResultType: "void"
Parameters:
- Position: 0
Type: "id<SharedKotlinx_coroutines_coreFlow> _Nonnull "
- Position: 1
Type: "SharedSkie_SuspendHandler *_Nonnull " |
Yeah, the extension receiver is indeed not mapped correctly. It should look like this:
Try adding the following annotation to your function:
You might need to add the following dependency to the module:
|
That unfortunately didn't do anything. Anything else I can try? |
For now, add the following group to your gradle configuration (after all your groups):
(You can remove the annotations, they are not needed.) I think I now have a good enough understanding of both of those issues and know how to fix them. So I will try that and let you know if I need further assistance with debugging. |
That fixes it indeed! Thanks for providing the workaround! 🙏 |
Fixed in 0.5.0. |
I have a Kotlin Flow extension function that basically converts a Flow to a simple return value based on the state of a result wrapper object:
However, this results in a compilation exception:
Details
The text was updated successfully, but these errors were encountered: