[ConstraintSystem] Allow to use keypath dynamic member lookup inside keypath expressions

This commit is contained in:
Pavel Yaskevich
2019-04-03 11:01:48 -07:00
parent bc4d01620b
commit e3ad92fbfb
6 changed files with 140 additions and 33 deletions

View File

@@ -1912,7 +1912,7 @@ void ConstraintSystem::resolveOverload(ConstraintLocator *locator,
auto memberTy = createTypeVariable(keyPathLoc, TVO_CanBindToLValue);
// Attempt to lookup a member with a give name in the root type and
// assign result to the leaf type of the keypath.
bool isSubscriptRef = isa<SubscriptExpr>(locator->getAnchor());
bool isSubscriptRef = locator->isSubscriptMemberRef();
DeclName memberName =
isSubscriptRef ? DeclBaseName::createSubscript() : choice.getName();