mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
A protocol conformance can be ill-formed due to isolation mismatches between witnesses and requirements, or with associated conformances. Previously, such failures would be emitted as a number of separate errors (downgraded to warnings in Swift 5), one for each witness and potentially an extra for associated conformances. The rest was a potential flood of diagnostics that was hard to sort through. Collect all of the isolation-related problems for a given conformance together and produce a single error (downgraded to a warning when appropriate) that describes the overall issue. That error will have up to three notes suggesting specific courses of action: * Isolating the conformance (when the experimental feature is enabled) * Marking the witnesses as 'nonisolated' where needed * The diagnostic also has notes to point out the witnesses/associated conformances that have isolation problems. There is a new educational note that also describes these options. We give the same treatment to missing 'distributed' on witnesses to a distributed protocol.
3.2 KiB
3.2 KiB