Open weissi opened 1 month ago
We went through the same during the Swift 4 to Swift 5 transition: https://gist.github.com/weissi/83d491d44ec4c7d7d93097b569339beb
But back then it was a little more difficult because #if compiler
didn't exist in Swift 4.{0,1,2}. So we had to use the weird 4.0.150
versions to mean "Swift 4.1 compiler in Swift 4 language mode"
#if swift(...)
is testing the language version and not the compiler version. We (almost) always want to check the compiler version.(This ticket should be for all repos in the
swift-nio*
family)Consider this program
output (on a recent Swift 6 preview snapshot)
language version 5 (default):
language version 4:
language version 6:
Please note how
compiler
does the right thing butswift
does not?