stencilproject/Stencil

Compiler warnings under Swift 4

paulmelnikow opened this issue · 7 comments

Hi, there are some compiler warnings about .characters in Swift 4. Would you accept a pull request to remove these? Or do you prefer to leave them alone, for compatibility with Swift 2–3?

kylef commented

Right now we still support Swift 3 so it would be breaking. Not sure when it makes sense to drop Swift 3 support though. Right now some tools that use Stencil (such as SwiftGen) still support Swift 3, so I'd wait for them to drop Swift 3 support before we do.

@kylef SwiftGen is using Stencil through StencilSwiftKit which is currently compiled with swift 3.2, as I can see. So it can be linked to swift 4 frameworks, so I think there is no problem in that.
Though there will be a breaking change related to KVO as swift 4 removes implicit @objc, so to access properties of objects via KVO they will need to be marked with @objc, or the type should be marked with @objcMembers. But I wouldn't stop updating because of that, as it is a well known change that touches any swift code that interferes with objc.
Even if we still don't migrate it would be good to get rid of warnings using #if swift

Another possibility: tools that need to support old versions could keep using an older version of Stencil.

Any word on this? I'd love to enable -Xswiftc -warnings-as-errors for my project (especially on CI) but can't do that until this is resolved.

FWIW I'm ok with mountain the code to Swift 4, so let's make a PR 👍

keith commented

It looks like this is fixed on master, so once there's a new release we can close this

djbe commented

Stencil 0.13 has been released 🎉