-
Notifications
You must be signed in to change notification settings - Fork 11
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
SuspendInterop: framework named shared
conflicts with object
shared
#131
Comments
Hi @boringcactus, thanks for the report. This is probably a bug in SKIE, because it should already rename the object reference |
I've been informed by a colleague that we didn't implement the |
Hello ! I have the same issue in my project when I try to build XCFramework with
|
Same issue here with almost the same configuration than boringcactus |
Questions:
What is the problem?
The default Kotlin Multiplatform settings for a new project created in Android Studio name the shared library
shared
and the iOS frameworkshared.framework
. However, the shared instance of a Kotlinobject Foo
is namedFoo.shared
in Swift, and SKIE's generated coroutine wrapper code does not handle this correctly. (Or perhaps its generated code used to work in Xcode 15 but does not work in Xcode 16.)The Kotlin code
will have the
Shared.Foo.swift
which will cause the build errors
Fixes I can imagine with my limited knowledge of Swift or how SKIE works internally:
shared
-the-module as opposed toshared
-the-static-member. It's not clear to me that this is actually possible in Swift, though.__SkieSuspendWrappersKt
instead of naming it viashared
. Presumably the module is specified explicitly for good reasons, though, so this may not be possible in the general case.shared
. This is worse, and it may still not work depending on the nature of the problems that the module qualifiers are there to fix.shared
andSuspendInterop
is enabled by default. If this error cannot be fixed except by renaming the framework, I'd rather rename the framework early and then never run into this error.shared
and anobject
has asuspend fun
withSuspendInterop
enabled. At the very least, this error message could be more informative than it currently is.When does the problem occur?
During Swift compilation (when trying to use the generated Kotlin Framework)
How do we reproduce the issue?
build.gradle.kts
:src/commonMain/kotlin/Foo.kt
:What has changed since the last time SKIE worked in your project?
I added a
suspend fun
to acompanion object
in a Kotlin Multiplatform project that uses the default structure.What versions of SKIE, Kotlin, and Gradle do you use?
SKIE 0.10.0, Kotlin 2.1.0, Gradle 8.9.
I'm also using Xcode 16.2, which might be interpreting Swift code that used to work correctly in a different way now, although my environment variables for the Gradle build step include
SWIFT_VERSION=5.0
and I'd expect that to be a Swift 6 thing if it was really what was happening.What is your SKIE Gradle configuration?
(This issue can be reproduced with the default SKIE settings.)
The text was updated successfully, but these errors were encountered: