@@ -1080,6 +1080,18 @@ namespace {
10801080 // Build a member reference.
10811081 auto memberRef = resolveConcreteDeclRef (member, memberLocator);
10821082
1083+ // If we're referring to a member type, it's just a type
1084+ // reference.
1085+ if (auto *TD = dyn_cast<TypeDecl>(member)) {
1086+ Type refType = simplifyType (openedType);
1087+ auto ref = TypeExpr::createForDecl (memberLoc, TD, cs.DC , /* isImplicit=*/ false );
1088+ cs.setType (ref, refType);
1089+ auto *result = new (context) DotSyntaxBaseIgnoredExpr (
1090+ base, dotLoc, ref, refType);
1091+ cs.setType (result, refType);
1092+ return result;
1093+ }
1094+
10831095 // If we're referring to the member of a module, it's just a simple
10841096 // reference.
10851097 if (baseTy->is <ModuleType>()) {
@@ -1093,18 +1105,6 @@ namespace {
10931105 return forceUnwrapIfExpected (DSBI, choice, memberLocator);
10941106 }
10951107
1096- // If we're referring to a member type, it's just a type
1097- // reference.
1098- if (auto *TD = dyn_cast<TypeDecl>(member)) {
1099- Type refType = simplifyType (openedType);
1100- auto ref = TypeExpr::createForDecl (memberLoc, TD, cs.DC , /* isImplicit=*/ false );
1101- cs.setType (ref, refType);
1102- auto *result = new (context) DotSyntaxBaseIgnoredExpr (
1103- base, dotLoc, ref, refType);
1104- cs.setType (result, refType);
1105- return result;
1106- }
1107-
11081108 bool isUnboundInstanceMember =
11091109 (!baseIsInstance && member->isInstanceMember ());
11101110 bool isPartialApplication = shouldBuildCurryThunk (choice, baseIsInstance);
0 commit comments