[SE-0111] Track function reference kinds in member references.

Extend the handling of function reference kinds to member references
(e.g., x.f), and therefore the logic for stripping argument labels. We
appear to be stripping argument labels from all of the places where it
is required.
This commit is contained in:
Doug Gregor
2016-07-28 14:27:27 -07:00
parent a9536906ff
commit 202cf2e754
13 changed files with 298 additions and 89 deletions

View File

@@ -2220,7 +2220,8 @@ bool FailureDiagnosis::diagnoseGeneralMemberFailure(Constraint *constraint) {
MemberLookupResult result =
CS->performMemberLookup(constraint->getKind(), constraint->getMember(),
baseTy, constraint->getLocator(),
baseTy, constraint->getFunctionRefKind(),
constraint->getLocator(),
/*includeInaccessibleMembers*/true);
switch (result.OverallResult) {
@@ -4535,7 +4536,7 @@ bool FailureDiagnosis::visitSubscriptExpr(SubscriptExpr *SE) {
MemberLookupResult result =
CS->performMemberLookup(ConstraintKind::ValueMember, subscriptName,
baseType, locator,
baseType, FunctionRefKind::DoubleApply, locator,
/*includeInaccessibleMembers*/true);
@@ -5716,7 +5717,9 @@ bool FailureDiagnosis::visitUnresolvedMemberExpr(UnresolvedMemberExpr *E) {
MemberLookupResult result =
CS->performMemberLookup(memberConstraint->getKind(),
memberConstraint->getMember(),
baseObjTy, memberConstraint->getLocator(),
baseObjTy,
memberConstraint->getFunctionRefKind(),
memberConstraint->getLocator(),
/*includeInaccessibleMembers*/true);
switch (result.OverallResult) {