-
Notifications
You must be signed in to change notification settings - Fork 225
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
Support swift 5.0 #268
Support swift 5.0 #268
Conversation
kawoou
commented
Jan 29, 2019
- Warning: 'index(where:)' is deprecated: renamed to 'firstIndex(where:)'
- Add [email protected]
- Update podspec swift version
That was quick! 😆 Are there other things we can potentially migrate? There are new Instead of peppering the code with |
Any word on this PR? I'd love to update to Swift 5 :) |
@djbe I want to support #"..."# syntax for readability. ex) #if swift(<5.0)
self.format = format ?? Variable("\"yyyy-MM-dd 'at' HH:mm\"")
#else
self.format = format ?? Variable(#""yyyy-MM-dd 'at' HH:mm""#)
#endif |
1a522a7
to
a52991d
Compare
Is there more info about that SIL exception? Is it new in Swift 5? Radar? |
Yeah, we won't be able to use raw strings until we drop 4.2 support 🤷♂️ |
@djbe Compile-time keywords(like #file) are expected to cause problems due to type inference errors during static dispatch. Before: Throw SIL Exception (https://travis-ci.org/stencilproject/Stencil/jobs/508764850) let path = Path(#file) + ".." + "fixtures" + "huge.html" After: let basePath: String = #file //< Specify type
let path = Path(basePath) + ".." + "fixtures" + "huge.html" |
Would this work then? let path = Path(#file as String) + ".." + "fixtures" + "huge.html" |
This changed fixed PathKit https://github.com/kylef/PathKit/pull/69/files#diff-663087ac5b85edfc8e4ff1dd83b915abL12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Unless there's any more feedback, I'll merge this tonight.
Awesome! Thanks so much for your effort on this! Mind tagging a release with Swift 5 support? |