Swift 6 compiler unexpected breaking change question

Although this package has been archived since 2021, I’ve found it useful and had no issues using it as a dependency.

GraphViz on GitHub

However, after upgrading to Xcode 16 (with Swift 6), I encountered a compiler error: Node.ID requires macOS 10.15. This is because Node conforms to Identifiable, and Node.ID is part of the associated ID from a protocol introduced in macOS 10.15.

It seems reasonable that the package should either specify a minimum platform requirement of macOS 10.15+ or use availability checks for Node’s conformance.

My question is: why did this package compile successfully with the Swift 5 compiler but now fail with the Swift 6 compiler?

Due to this unexpected breaking change, I had to fork the package and address the issue myself, which is manageable since it’s a single package. However, I’m concerned that this could affect other similar packages and potentially erode confidence in Swift's source compatibility.

Any insights or guidance on this issue would be greatly appreciated.

1 Like

Have you tried the latest released Xcode (16.2)? The package builds without any errors for me with it. I believe this was fixed in 16.1 by Sema: Relax availability of typealiases for inferred type witness by tshortli · Pull Request #76066 · swiftlang/swift · GitHub.

3 Likes

Ah, I see! I was using Xcode 16.0. Thanks for the update!

1 Like