Files
swift-mirror/lib/AST/GenericSignature.cpp
Kavon Farvardin b2e698ec41 SuppAssocDefaults: update getRequirementsWithInverses
Given that we implicitly expanded Copyable & Escapable
conformance requirements for suppressed primary associated
types, we now need this function to do the opposite;
filtering Copyable & Escapable requirements on such primary
associated types and adding inverses if those requirements
are missing.

This function plays a crucial role in emitting the interface
files accurately for functions and types, in addition to
how we mangle generic signatures into function symbols.

The mangling for generic signatures under the -WithDefaults version of
suppressed associated types goes like this:

- primary associated type T.A has an inverse `Rj` or `RJ` mangled
  into the generic signature if it lacks the conformance, or
  nothing is mangled into it.

- non-primary associated type T.B has either a `T.B: Copyable`
  requirement mangled into it, or nothing is mangled into it.

For the legacy SuppressedAssociatedTypes feature, where there's no
defaults, it uses the "non-primary assocated type" mangling strategy
for all generic signatures.
2026-02-09 16:10:00 -08:00

53 KiB