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

Test in Swift 3 compatibility mode #431

Merged
merged 5 commits into from
Jun 3, 2017
Merged

Conversation

sharplet
Copy link
Contributor

@sharplet sharplet commented Jun 1, 2017

I think it would be ideal to add Nimble to the Swift 3 source compatibility suite. This PR should hopefully demonstrate that Nimble doesn't compile in Swift 3 compatibility mode. The two issues I've noticed:

  • NSFastEnumerationIterator is a struct now, not a class
  • The overload rules appear to have changed, and the tests don't compile due to ambiguous matcher overloads

I haven't deeply investigated the requirements for the source compatibility suite, but I wanted to kick of the discussion.


Update!

Turns it's only a very minor change required to get -swift-version 3 working! I'm still not quick sure if we should merge with this change because of the warning under Swift 3, but I'm now successfully consuming Nimble from a Swift 4 project.

@sharplet sharplet force-pushed the as-swift-4-swift-3-compat branch from c531c16 to a16802b Compare June 2, 2017 20:44
@sharplet
Copy link
Contributor Author

sharplet commented Jun 2, 2017

@Quick/core Would love your input on whether to merge with this warning. If so, we could put out a patch release that supports Swift 4.

@pigeondotdev
Copy link

Please confirm. There's a warning with Swift 3 but everything is still compatible with Swift 3 and you have a working version for Swift 4? If so, LGTM (but I still recommend that we hear from a few others in the core team.

@modocache
Copy link
Member

Sounds good, feel free to merge :)

@sharplet
Copy link
Contributor Author

sharplet commented Jun 2, 2017

There's a warning with Swift 3 but everything is still compatible with Swift 3 and you have a working version for Swift 4?

That's correct. In Swift 3 this change generates a new warning (and infuriatingy a fixit), and under Swift 4 in compatibility mode compiles without any new warnings.

We may also need to add -swift-version 3 for this to compile in Xcode under Swift 4. I'll investigate this before merging.

@sharplet
Copy link
Contributor Author

sharplet commented Jun 3, 2017

Ok, I've added the -swift-version 3 flag to the xcodeproj. Xcode made some automatic changes, so I committed those also.

Note: The tests don't compile under Swift 4 due to operator overload ambiguity. I don't know why, but it seems like maybe a Swift 3 compatibility bug? This also probably indicates that Swift 4 consumers won't be able to use certain operators right now, but at least compiling is a start!

@jeffh jeffh merged commit 4cfe93e into master Jun 3, 2017
@jeffh jeffh deleted the as-swift-4-swift-3-compat branch June 3, 2017 18:11
@jeffh
Copy link
Member

jeffh commented Jun 3, 2017

Thanks @sharplet!

@jeffh jeffh modified the milestone: v7.0.2 (Next Release) Jul 18, 2017
Megal pushed a commit to Megal/Nimble that referenced this pull request Jul 31, 2019
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.

4 participants