Pitch: [SwiftPM] Swift Language Version Per Target

I think this is an important pitch, because incremental migration per-target is critical for the Swift 6 migration, including for packages. I have a few minor comments/questions

Should we call this swiftLanguageVersion since the term "Swift version" is ambiguous between "language" and "tools"?

It's worth clarifying what the default language version actually is when using Swift 6.0 tools, because I think it's debatable. Personally, I don't think the default when using Swift 6.0 tools should be Swift 6 mode - that's not the default in the compiler, because otherwise source compatibility won't be maintained for existing code. I can see an argument that maybe the SwiftPM behavior should be different because you need to explicitly change the package manifest to require 6.0 tools, but I also don't think using 6.0 tools is an indication that the package wants to use the Swift 6 language mode by default.

I agree with the choice to use SwiftLanguageVersion in the API here. Will you also add a v6 static let? e.g.

    /// Swift language version 6.
    public static let v6 = SwiftLanguageVersion(uncheckedString: "6")
3 Likes