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

[PoC] Modify materialize overload of Result<T, NSError> to be buildable on both Swift 3.0 and 3.1 #214

Merged
merged 3 commits into from
Mar 3, 2017

Conversation

ikesyo
Copy link
Member

@ikesyo ikesyo commented Mar 1, 2017

This is an alternative approach to address #212 (see also #213). This does not require major version bump so make it easy to upgrade to Swift 3.1. But I'm not confident if this is acceptable.

.travis.yml Outdated
@@ -29,5 +29,10 @@ matrix:
language: generic
install:
- eval "$(curl -sL https://gist.githubusercontent.com/kylef/5c0475ff02b7c7671d2a/raw/9f442512a46d7a2af7b850d65a7e9bd31edfb09b/swiftenv-install.sh)"
- script:
- docker run -v `pwd`:`pwd` -w `pwd` norionomura/swift:3120170205a swift test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This deserves a comment as I'm not really sure what it's doing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced it with a recent 3.1-DEVELOPMENT-SNAPSHOT on Linux: b26e951

let userInfo = _swift_Foundation_getErrorDefaultUserInfo(error) as? [String: Any]
let nsError = NSError(domain: error._domain, code: error._code, userInfo: userInfo)
return .failure(nsError)
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is acceptable, but would prefer to see a comment that says something like "This isn't great, but it lets us maintain compatibility until this deprecated method can be removed."

@ikesyo ikesyo force-pushed the swift-3.1-linux-compatibility branch from 8ee52de to 939c0f3 Compare March 2, 2017 18:00
@mdiep mdiep merged commit 7df607a into master Mar 3, 2017
@mdiep mdiep deleted the swift-3.1-linux-compatibility branch March 3, 2017 01:02
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

Successfully merging this pull request may close these issues.

2 participants