mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
First, we need this to work on both lowered and unlowered types, so Type::subst is problematic: it'll assert if it sees a type like SILFunctionType. In this case, the substitution is simple enough that that's never a problem, but Type::subst doesn't know that, and the assertion is generally a good one. Second, we need this to not recurse into nested pack expansions. Third, we need this to not mess around with any existing element archetypes we might see in the type, so mapping in and out of context is not really okay. Fortunately, because we're mapping between structures (pack and element archetypes) that are guaranteed to have the same constraints, this transformation is really easy and we can just do it with transformRec.
14 KiB
14 KiB