mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
19119ad88a
@_preInverseGenerics(except: <inverses>) is an extension of the existing @_preInverseGenerics attribute that provides selective control over which inverse requirements are mangled into a declaration's symbol name. While the bare @_preInverseGenerics strips all inverse constraints (~Copyable and ~Escapable) from mangling, the 'except:' form allows specific inverses to be retained. This is needed when a type like Span already had ~Copyable mangled into its ABI-stable symbols and now needs to retroactively adopt ~Escapable without changing those existing symbols. You can now express that with `@_preInverseGenerics(except: ~Copyable)` to strip-out every inverse except ~Copyable to preserve the pre-existing ~Copyable-containing symbols. It requires the new experimental feature `PreInverseGenericsExcept`. rdar://176395527