mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
AST: Clean up getMemberSubstitutions() and friends
Rename the old getMemberSubstitutions() to getContextSubstitutions() and add a new getMemberSubstitutions() that takes a ValueDecl, rather than the member's DeclContext. This new method forwards generic parameters if the member is a generic function.
This commit is contained in:
@@ -1985,15 +1985,14 @@ public:
|
||||
MaybeNominalType->getAnyOptionalObjectType())
|
||||
MaybeNominalType = MaybeNominalType->getAnyOptionalObjectType();
|
||||
|
||||
// For dynamic lookup don't substitute in the base type
|
||||
// For dynamic lookup don't substitute in the base type.
|
||||
if (MaybeNominalType->isAnyObject())
|
||||
return T;
|
||||
|
||||
// For everything else, substitute in the base type.
|
||||
//
|
||||
// Pass in DesugarMemberTypes so that we see the actual
|
||||
// concrete type witnesses instead of type alias types.
|
||||
auto Subs = MaybeNominalType->getMemberSubstitutions(
|
||||
auto Subs = MaybeNominalType->getContextSubstitutions(
|
||||
VD->getDeclContext());
|
||||
T = T.subst(M, Subs, (SubstFlags::DesugarMemberTypes |
|
||||
SubstFlags::UseErrorType));
|
||||
|
||||
Reference in New Issue
Block a user