PromiseKit
PromiseKit copied to clipboard
Crash on iOS11/12
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
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
Hello @zzzzzyijie Please provide more details.
What does the crash say? Something generic like EXC_BAD_ACCESS or something more specific?
Closing because I don't have enough context to reproduce this crash. Please create an example project with this crash and share it here once it is ready.