mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Get rid of old form of Type::subst()
First, add some new utility methods to create SubstitutionMaps: - GenericSignature::getSubstitutionMap() -- provides a new way to directly build a SubstitutionMap. It takes a TypeSubstitutionFn and LookupConformanceFn. This is equivalent to first calling getSubstitutions() with the two functions to create an ArrayRef<Substitution>, followed by the old form of getSubstitutionMap() on the result. - TypeBase::getContextSubstitutionMap() -- replacement for getContextSubstitutions(), returning a SubstitutionMap. - TypeBase::getMemberSubstitutionMap() -- replacement for getMemberSubstitutions(), returning a SubstitutionMap. With these in place, almost all existing uses of subst() taking a ModuleDecl can now use the new form taking a SubstitutionMap instead. The few remaining cases are explicitly written to use a TypeSubstitutionFn and LookupConformanceFn.
This commit is contained in:
@@ -387,8 +387,8 @@ public:
|
||||
/// substitution according to the witness substitutions.
|
||||
CanType getSubstWitnessInterfaceType(CanType type) {
|
||||
auto subs = SubstSelfType->getRValueInstanceType()
|
||||
->getMemberSubstitutions(WitnessStorage);
|
||||
return type.subst(SGM.SwiftModule, subs)->getCanonicalType();
|
||||
->getMemberSubstitutionMap(SGM.SwiftModule, WitnessStorage);
|
||||
return type.subst(subs)->getCanonicalType();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user