Swift 6 building a Swift 6 package doesn't build in Swift 6 mode?!

i.e. #if swift(>=6) evaluates to false with the Swift 6 compiler on a Swift 6 package. This seems rather unintuitive.

I can make it actually use Swift 6 by explicitly forcing that mode in the package settings. I'm just surprised that I need to in this situation. Are we expect to always have to explicitly opt into Swift 6?

#if swift() refers to the language mode being used to build the target. #if compiler() refers to the actual Swift compiler version being used to build the target.

1 Like

Ah, thanks, I didn't know about the compiler() clause. That will help with some tangential issues.

1 Like