mirror of
https://github.com/apple/swift.git
synced 2026-10-14 15:51:20 +02:00
Move `Comparable` derivation to a macro under a feature flag Adds a `DeriveConformancesViaMacros` feature flag path for deriving `<(_:_:)` on eligible enums. When enabled, `DerivedConformance::deriveComparable` builds a `#_deriveComparable(...)` macro call instead of hand-crafting the AST nodes, and the new `DeriveComparableMacro` (in`SwiftMacros`) expands it. Type info is encoded in a similar way as for `Equatable`, reusing the enum information logic. The non-macro path is untouched. This is opt-in via the feature flag. --------- Co-authored-by: Paul Passeron <paul_passeron@apple.com>