Skip to content
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

Crash on iOS11/12 #1295

Open
zzzzzyijie opened this issue Aug 27, 2022 · 3 comments
Open

Crash on iOS11/12 #1295

zzzzzyijie opened this issue Aug 27, 2022 · 3 comments

Comments

@zzzzzyijie
Copy link

zzzzzyijie commented Aug 27, 2022

it will crash on iOS11/12
because of this code:

version: 6.18.0
#if swift(>=5.5)
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
public extension Guarantee {
func async() async -> T {
await withCheckedContinuation { continuation in
done { value in
continuation.resume(returning: value)
}
}
}
}

@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
public extension Promise {
func async() async throws -> T {
try await withCheckedThrowingContinuation { continuation in
done { value in
continuation.resume(returning: value)
}.catch { error in
continuation.resume(throwing: error)
}
}
}
}
#endif

@zzzzzyijie
Copy link
Author

verson: 6.18.1
Xcode: 13.2

it will crash too!! on iOS11/12...

#if swift(>=5.5)
#if canImport(_Concurrency)
@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
public extension Guarantee {
func async() async -> T {
await withCheckedContinuation { continuation in
done { value in
continuation.resume(returning: value)
}
}
}
}

@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.0, *)
public extension Promise {
func async() async throws -> T {
try await withCheckedThrowingContinuation { continuation in
done { value in
continuation.resume(returning: value)
}.catch { error in
continuation.resume(throwing: error)
}
}
}
}
#endif
#endif

@RomanPodymov
Copy link
Collaborator

Hello @zzzzzyijie
Please provide more details.

@isaac-weisberg
Copy link

What does the crash say? Something generic like EXC_BAD_ACCESS or something more specific?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants