Looks like coroutine cancellation working in `2.3....
# swift-export
j
Looks like coroutine cancellation working in
2.3.20-dev-6091
🎉
👀 6
🎉 6
K 2
swift 3
kodee happy 2
Have created minimal sample to test it out. https://github.com/joreilly/SwiftExportTest
Testing this out by opening 2nd SwiftUI view that calls Kotlin suspend function (using await from task view modifier). That suspend function calls delay() and if we go back from view before that finishes then we get following: "Failed to get greeting: CancellationError()"
Copy code
struct SomeOtherView: View {
    @State private var greeting = ""
    var body: some View {
        VStack {
            Text(greeting)
        }
        .task {
            do {
                greeting = try await Greeting().suspendGreet()
                print(greeting)
            } catch {
                print("Failed to get greeting: \(error)")
            }
        }
    }
}
u
wait..out of the box, without skie?
😉 1
g
but
kotlin.native.HiddenFromObjC
is no where to be seen 😅 (CC:@Artem Olkov)
kodee sad 1
(dev-6204 too)
inside commonMain, inside iosMain is there 🤔
Copy code
kotlin.experimental.ExperimentalObjCRefinement
is found in both sourceSets
a
@Guilherme Delgado thanks, but I'm on a vacation till Thursday, sooo do you mind creating a reproducer and filing a ticket for that? 🙂
g
Yes of course, I’ll double check it also to avoid a false positive 😉 Enjoy your vacations!
thank you color 1
a
@Guilherme Delgado how's it going, were you able to file a ticket for that? 🙂
g
Not yet. It’s really strange, I can’t create a reproducible example 😕. In my project, this only happens in the
commonMain
of a specific module, and it occurs even if I downgrade Kotlin. I think I’ll try cloning the project again to see if it still happens.
👌 1