Library cannot compile for Swift 5 #9

Closed
opened 2025-09-11 08:53:10 +00:00 by javier · 1 comment
Owner

Summary

Based on the results of the latest build results at the Swift Package Index, the SPM package cannot compile for Swift v5.

Explanation

From what the logs are telling, the declaration of a specific error thrown at a function is not supported by the mentioned version of the Swift compiler. These definitions are being used on the functions defined at the AmiiboService service type and at the APIClient protocol as well, like this:

func someFunctions() async throws(AmiiboServiceError)

Posible solution

Both the AmiiboService service type and the APIClient protocol should have two functions definitions, one for Swift 5 and another for Swift 6. The same goes for the types that conforms to this particular protocol. It is assumed that a syntax like this will be used to solve this issue:

#if swift(>=6.0)
    // …
#else 
    // …
#endif
# Summary Based on the results of the [latest build results](https://swiftpackageindex.com/rock-n-code/amiibo-service/builds) at the Swift Package Index, the SPM package cannot compile for Swift v5. # Explanation From what the logs are telling, the declaration of a specific error thrown at a function is not supported by the mentioned version of the Swift compiler. These definitions are being used on the functions defined at the `AmiiboService` service type and at the `APIClient` protocol as well, like this: ```swift func someFunctions() async throws(AmiiboServiceError) ``` # Posible solution Both the `AmiiboService` service type and the `APIClient` protocol should have two functions definitions, one for Swift 5 and another for Swift 6. The same goes for the types that conforms to this particular protocol. It is assumed that a syntax like this will be used to solve this issue: ```swift #if swift(>=6.0) // … #else // … #endif ```
javier added the Kind/Bug
Priority
Critical
labels 2025-09-11 08:53:10 +00:00
javier self-assigned this 2025-09-11 08:53:10 +00:00
Author
Owner

Fixed in PR #11.

Fixed in PR #11.
Sign in to join this conversation.