PromiseKit icon indicating copy to clipboard operation
PromiseKit copied to clipboard

Crash on iOS11/12

Open zzzzzyijie opened this issue 2 years ago • 3 comments

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 avatar Aug 27 '22 14:08 zzzzzyijie

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

zzzzzyijie avatar Aug 27 '22 14:08 zzzzzyijie

Hello @zzzzzyijie Please provide more details.

RomanPodymov avatar Sep 06 '22 11:09 RomanPodymov

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

isaac-weisberg avatar Sep 07 '22 10:09 isaac-weisberg

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.

RomanPodymov avatar May 11 '24 08:05 RomanPodymov