mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[AST] Split out "is compound" bit on FunctionRefInfo
FunctionRefKind was originally designed to represent the handling needed for argument labels on function references, in which the unapplied and compound cases are effectively the same. However it has since been adopted in a bunch of other places where the spelling of the function reference is entirely orthogonal to the application level. Split out the application level from the "is compound" bit. Should be NFC. I've left some FIXMEs for non-NFC changes that I'll address in a follow-up.
This commit is contained in:
@@ -2349,7 +2349,7 @@ AssignmentFailure::resolveImmutableBase(Expr *expr) const {
|
||||
dyn_cast_or_null<SubscriptDecl>(declRef.getDecl())) {
|
||||
if (isImmutable(subscript))
|
||||
return {expr, OverloadChoice(getType(SE->getBase()), subscript,
|
||||
FunctionRefInfo::DoubleApply)};
|
||||
FunctionRefInfo::doubleBaseNameApply())};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2405,7 +2405,7 @@ AssignmentFailure::resolveImmutableBase(Expr *expr) const {
|
||||
if (auto member = dyn_cast<AbstractStorageDecl>(MRE->getMember().getDecl()))
|
||||
if (isImmutable(member))
|
||||
return {expr, OverloadChoice(getType(MRE->getBase()), member,
|
||||
FunctionRefInfo::SingleApply)};
|
||||
FunctionRefInfo::singleBaseNameApply())};
|
||||
|
||||
// If we weren't able to resolve a member or if it is mutable, then the
|
||||
// problem must be with the base, recurse.
|
||||
@@ -2425,8 +2425,8 @@ AssignmentFailure::resolveImmutableBase(Expr *expr) const {
|
||||
}
|
||||
|
||||
if (auto *DRE = dyn_cast<DeclRefExpr>(expr))
|
||||
return {expr,
|
||||
OverloadChoice(Type(), DRE->getDecl(), FunctionRefInfo::Unapplied)};
|
||||
return {expr, OverloadChoice(Type(), DRE->getDecl(),
|
||||
FunctionRefInfo::unappliedBaseName())};
|
||||
|
||||
// Look through x!
|
||||
if (auto *FVE = dyn_cast<ForceValueExpr>(expr))
|
||||
@@ -4387,7 +4387,7 @@ bool MissingMemberFailure::diagnoseAsError() {
|
||||
|
||||
auto result = cs.performMemberLookup(
|
||||
ConstraintKind::ValueMember, getName().withoutArgumentLabels(),
|
||||
metatypeTy, FunctionRefInfo::DoubleApply, getLocator(),
|
||||
metatypeTy, FunctionRefInfo::doubleBaseNameApply(), getLocator(),
|
||||
/*includeInaccessibleMembers=*/true);
|
||||
|
||||
// If there are no `init` members at all produce a tailored
|
||||
|
||||
Reference in New Issue
Block a user