mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ConstraintSystem] Use getNumApplications + ValueDecl::getNumCurryLevels to detect partial applications
We used to detect partial applications based on member locators and parent expressions, but using function reference kind + check to see if self is applied is such simpler and hits both uses of `isPartialApplication`.
This commit is contained in:
@@ -1655,8 +1655,8 @@ static unsigned getNumRemovedArgumentLabels(ValueDecl *decl,
|
||||
}
|
||||
|
||||
/// Determine the number of applications
|
||||
static unsigned getNumApplications(
|
||||
ValueDecl *decl, bool hasAppliedSelf, FunctionRefKind functionRefKind) {
|
||||
unsigned constraints::getNumApplications(ValueDecl *decl, bool hasAppliedSelf,
|
||||
FunctionRefKind functionRefKind) {
|
||||
switch (functionRefKind) {
|
||||
case FunctionRefKind::Unapplied:
|
||||
case FunctionRefKind::Compound:
|
||||
@@ -1774,7 +1774,7 @@ FunctionType *ConstraintSystem::adjustFunctionTypeForConcurrency(
|
||||
adjustedTy =
|
||||
adjustedTy->withExtInfo(adjustedTy->getExtInfo().withSendable());
|
||||
}
|
||||
} else if (isPartialApplication(getConstraintLocator(locator))) {
|
||||
} else if (numApplies < decl->getNumCurryLevels()) {
|
||||
// Operators on protocols could be found via unqualified lookup and
|
||||
// won't have a base type.
|
||||
if (decl->isOperator() ||
|
||||
|
||||
Reference in New Issue
Block a user