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

Bug: Swift >= 5.2 Key Path Expressions #127

Closed
crherman7 opened this issue Dec 28, 2020 · 2 comments · Fixed by #128
Closed

Bug: Swift >= 5.2 Key Path Expressions #127

crherman7 opened this issue Dec 28, 2020 · 2 comments · Fixed by #128
Labels
bug Something isn't working

Comments

@crherman7
Copy link

crherman7 commented Dec 28, 2020

🌎 Environment

  • OS Version: iOS 14.0 Xcode 12.0.1
  • Version/Commit: 1.0.4

💬 Description

Swift key path expressions are only valid in Swift version 5.2 or above unless provided a custom extension. The .podspec file denotes that 5.1 is the minimum necessary Swift version to be utilized. If developers are utilizing below 5.2 they will run into

Type of expression is ambiguous without more context

at

guard Locales.validSet.map(\.currencyCode).contains(currencyCode) else {
.

🦶 Reproduction Steps

Steps to reproduce the behavior:

  1. Attempt to compile project with Afterpay SDK with Swift version 5.1

🤔 Expected Results

No error since the podspec denotes Swift version as 5.1.

😲 Actual Results

Type of expression is ambiguous without more context

at

guard Locales.validSet.map(\.currencyCode).contains(currencyCode) else {
.

Screenshots

image

Suggestion

  1. Update
    spec.swift_version = "5.1"
    to be spec.swift_version = "5.2" or include the appropriate extension to handle key path expressions.
@crherman7 crherman7 added the bug Something isn't working label Dec 28, 2020
@adamjcampbell
Copy link
Contributor

Thanks @crherman7 I'll raise the requirements as it seems that the latest version cannot be used at the lower versions as it is.

@crherman7
Copy link
Author

@adamjcampbell thank you for the quick change and release 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants