@@ -1577,8 +1577,8 @@ namespace {
1577
1577
ConstraintLocatorBuilder memberLocator, bool Implicit,
1578
1578
AccessSemantics semantics) {
1579
1579
const auto &choice = overload.choice ;
1580
- const auto openedType = overload.openedType ;
1581
- const auto adjustedOpenedType = overload.adjustedOpenedType ;
1580
+ const auto openedType = simplifyType ( overload.openedType ) ;
1581
+ const auto adjustedOpenedType = simplifyType ( overload.adjustedOpenedType ) ;
1582
1582
1583
1583
ValueDecl *member = choice.getDecl ();
1584
1584
@@ -1639,7 +1639,7 @@ namespace {
1639
1639
// If we're referring to a member type, it's just a type
1640
1640
// reference.
1641
1641
if (auto *TD = dyn_cast<TypeDecl>(member)) {
1642
- Type refType = simplifyType ( adjustedOpenedType) ;
1642
+ Type refType = adjustedOpenedType;
1643
1643
auto ref = TypeExpr::createForDecl (memberLoc, TD, dc);
1644
1644
cs.setType (ref, refType);
1645
1645
auto *result = new (context) DotSyntaxBaseIgnoredExpr (
@@ -1770,10 +1770,8 @@ namespace {
1770
1770
ref->setImplicit (Implicit);
1771
1771
// FIXME: FunctionRefKind
1772
1772
1773
- auto computeRefType = [&](Type openedType) {
1774
- // Compute the type of the reference.
1775
- Type refType = simplifyType (openedType);
1776
-
1773
+ // Compute the type of the reference.
1774
+ auto computeRefType = [&](Type refType) {
1777
1775
// If the base was an opened existential, erase the opened
1778
1776
// existential.
1779
1777
if (openedExistential) {
@@ -1859,7 +1857,7 @@ namespace {
1859
1857
// type having 'Self' swapped for the appropriate replacement
1860
1858
// type -- usually the base object type.
1861
1859
if (hasDynamicSelf) {
1862
- const auto conversionTy = simplifyType ( adjustedOpenedType) ;
1860
+ const auto conversionTy = adjustedOpenedType;
1863
1861
if (!containerTy->isEqual (conversionTy)) {
1864
1862
result = cs.cacheType (new (context) CovariantReturnConversionExpr (
1865
1863
result, conversionTy));
@@ -1967,7 +1965,7 @@ namespace {
1967
1965
1968
1966
auto *closure = buildSingleCurryThunk (
1969
1967
baseRef, declRefExpr, cast<AbstractFunctionDecl>(member),
1970
- simplifyType ( adjustedOpenedType) ->castTo <FunctionType>(),
1968
+ adjustedOpenedType->castTo <FunctionType>(),
1971
1969
memberLocator);
1972
1970
1973
1971
// Wrap the closure in a capture list.
@@ -1994,7 +1992,7 @@ namespace {
1994
1992
// must be downcast to the opened archetype before being erased to the
1995
1993
// subclass existential to cope with the expectations placed
1996
1994
// on 'CovariantReturnConversionExpr'.
1997
- curryThunkTy = simplifyType ( adjustedOpenedType) ->castTo <FunctionType>();
1995
+ curryThunkTy = adjustedOpenedType->castTo <FunctionType>();
1998
1996
} else {
1999
1997
curryThunkTy = adjustedRefTy->castTo <FunctionType>();
2000
1998
@@ -2060,7 +2058,7 @@ namespace {
2060
2058
apply = ConstructorRefCallExpr::create (context, ref, base);
2061
2059
} else if (isUnboundInstanceMember) {
2062
2060
ref = adjustTypeForDeclReference (
2063
- ref, cs.getType (ref), cs. simplifyType ( adjustedOpenedType) ,
2061
+ ref, cs.getType (ref), adjustedOpenedType,
2064
2062
locator);
2065
2063
2066
2064
// Reference to an unbound instance method.
0 commit comments