@@ -1061,7 +1061,6 @@ namespace {
1061
1061
AccessSemantics semantics) {
1062
1062
auto choice = overload.choice ;
1063
1063
auto openedType = overload.openedType ;
1064
- auto openedFullType = overload.openedFullType ;
1065
1064
1066
1065
ValueDecl *member = choice.getDecl ();
1067
1066
@@ -1097,13 +1096,15 @@ namespace {
1097
1096
return result;
1098
1097
}
1099
1098
1099
+ auto refTy = simplifyType (overload.openedFullType );
1100
+
1100
1101
// If we're referring to the member of a module, it's just a simple
1101
1102
// reference.
1102
1103
if (baseTy->is <ModuleType>()) {
1103
1104
assert (semantics == AccessSemantics::Ordinary &&
1104
1105
" Direct property access doesn't make sense for this" );
1105
1106
auto ref = new (context) DeclRefExpr (memberRef, memberLoc, Implicit);
1106
- cs.setType (ref, simplifyType (openedFullType) );
1107
+ cs.setType (ref, refTy );
1107
1108
ref->setFunctionRefKind (choice.getFunctionRefKind ());
1108
1109
auto *DSBI = cs.cacheType (new (context) DotSyntaxBaseIgnoredExpr (
1109
1110
base, dotLoc, ref, cs.getType (ref)));
@@ -1114,8 +1115,6 @@ namespace {
1114
1115
(!baseIsInstance && member->isInstanceMember ());
1115
1116
bool isPartialApplication = shouldBuildCurryThunk (choice, baseIsInstance);
1116
1117
1117
- auto refTy = simplifyType (openedFullType);
1118
-
1119
1118
// The formal type of the 'self' value for the member's declaration.
1120
1119
Type containerTy = getBaseType (refTy->castTo <FunctionType>());
1121
1120
@@ -1278,8 +1277,8 @@ namespace {
1278
1277
= new (context) MemberRefExpr (base, dotLoc, memberRef,
1279
1278
memberLoc, Implicit, semantics);
1280
1279
memberRefExpr->setIsSuper (isSuper);
1280
+ cs.setType (memberRefExpr, refTy->castTo <FunctionType>()->getResult ());
1281
1281
1282
- cs.setType (memberRefExpr, simplifyType (openedType));
1283
1282
Expr *result = memberRefExpr;
1284
1283
closeExistential (result, locator);
1285
1284
0 commit comments