stencilproject / Stencil

Stencil is a simple and powerful template language for Swift.
https://stencil.fuller.li
BSD 2-Clause "Simplified" License
2.34k stars 223 forks source link

Compiler warnings under Swift 4 #155

Closed paulmelnikow closed 5 years ago

paulmelnikow commented 6 years ago

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 6 years ago

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.

ilyapuchka commented 6 years ago

@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

paulmelnikow commented 6 years ago

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

soffes commented 6 years ago

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.

AliSoftware commented 6 years ago

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

keith commented 5 years ago

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

djbe commented 5 years ago

Stencil 0.13 has been released 🎉