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

@autoclosure in Swift 5 #100

Closed
madcato opened this issue May 28, 2019 · 4 comments · Fixed by #101
Closed

@autoclosure in Swift 5 #100

madcato opened this issue May 28, 2019 · 4 comments · Fixed by #101

Comments

@madcato
Copy link

madcato commented May 28, 2019

In Sources/Runes/Optional/Optional+Alternative.swift:14 an @autclosure block is passed as an argument. This is forbidden in Swift 5.

From Swift 5 release notes:

In Swift 5 mode, @autoclosure parameters can no longer be forwarded to @autoclosure arguments in another function call. Instead, you must explicitly call the function value with parentheses: (); the call itself is wrapped inside an implicit closure, guaranteeing the same behavior as in Swift 4 mode. (SR-5719) (37321597)

Is there any solution for this?

@gfontenot
Copy link
Collaborator

It sounds like the solution is to change that line to return lhs.or(rhs()), which I'm OK with. Feel like submitting a PR to fix it?

@gfontenot
Copy link
Collaborator

Also, is this causing a compiler error for Swift 5?

@madcato
Copy link
Author

madcato commented May 28, 2019

It sounds like the solution is to change that line to return lhs.or(rhs()), which I'm OK with. Feel like submitting a PR to fix it?

Ok, I'll do it.

Also, is this causing a compiler error for Swift 5?

Yes, but only occurs in my CI environment. Compiling locally in my machine doesn't produce any error.

@gfontenot
Copy link
Collaborator

The fix for this is now available in 4.2.2 (uploading to CocoaPods now)

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 a pull request may close this issue.

2 participants