swift
5b90b885 - Generalize protocol conformance options spelled via attribute and incorporate @unsafe

Commit
286 days ago
Generalize protocol conformance options spelled via attribute and incorporate @unsafe Protocol conformances have a handful attributes that can apply to them directly, including @unchecked (for Sendable), @preconcurrency, and @retroactive. Generalize this into an option set that we carry around, so it's a bit easier to add them, as well as reworking the serialization logic to deal with an arbitrary number of such options. Use this generality to add support for @unsafe conformances, which are needed when unsafe witnesses are used to conform to safe requirements. Implement general support for @unsafe conformances, including producing a single diagnostic per missing @unsafe that provides a Fix-It and collects together all of the unsafe witnesses as notes.
Author
Committer
Parents
Loading