@@ -1478,7 +1478,7 @@ namespace {
1478
1478
1479
1479
const bool isUnboundInstanceMember =
1480
1480
(!baseIsInstance && member->isInstanceMember ());
1481
- const bool isPartialApplication =
1481
+ const bool needsCurryThunk =
1482
1482
shouldBuildCurryThunk (choice, baseIsInstance);
1483
1483
1484
1484
// The formal type of the 'self' value for the member's declaration.
@@ -1511,7 +1511,7 @@ namespace {
1511
1511
// the thunk to accept a class to avoid potential abstraction, so the
1512
1512
// existential base must be opened eagerly in order to be upcast to the
1513
1513
// appropriate class reference type before it is passed to the thunk.
1514
- if (!isPartialApplication ||
1514
+ if (!needsCurryThunk ||
1515
1515
(!member->getDeclContext ()->getSelfProtocolDecl () &&
1516
1516
!isUnboundInstanceMember)) {
1517
1517
// Open the existential before performing the member reference.
@@ -1590,7 +1590,7 @@ namespace {
1590
1590
}
1591
1591
1592
1592
// Handle dynamic references.
1593
- if (isDynamic || (!isPartialApplication &&
1593
+ if (isDynamic || (!needsCurryThunk &&
1594
1594
member->getAttrs ().hasAttribute <OptionalAttr>())) {
1595
1595
base = cs.coerceToRValue (base);
1596
1596
Expr *ref = new (context) DynamicMemberRefExpr (base, dotLoc, memberRef,
@@ -1690,12 +1690,12 @@ namespace {
1690
1690
// very specific shape, we only emit a single closure here and
1691
1691
// capture the original SuperRefExpr, since its evaluation does not
1692
1692
// have side effects, instead of abstracting out a 'self' parameter.
1693
- const auto isSuperPartialApplication = isPartialApplication && isSuper;
1693
+ const auto isSuperPartialApplication = needsCurryThunk && isSuper;
1694
1694
if (isSuperPartialApplication) {
1695
1695
ref = buildSingleCurryThunk (base, declRefExpr,
1696
1696
cast<AbstractFunctionDecl>(member),
1697
1697
memberLocator);
1698
- } else if (isPartialApplication ) {
1698
+ } else if (needsCurryThunk ) {
1699
1699
// Another case where we want to build a single closure is when
1700
1700
// we have a partial application of a constructor on a statically-
1701
1701
// derived metatype value. Again, there are no order of evaluation
0 commit comments