@@ -1594,19 +1594,19 @@ DeclReferenceType ConstraintSystem::getTypeOfMemberReference(
1594
1594
ASSERT (!!preparedOverload == PreparingOverload);
1595
1595
1596
1596
// Figure out the instance type used for the base.
1597
- Type resolvedBaseTy = getFixedTypeRecursive ( baseTy, /* wantRValue= */ true );
1597
+ Type baseRValueTy = baseTy-> getRValueType ( );
1598
1598
1599
1599
// If the base is a module type, just use the type of the decl.
1600
- if (resolvedBaseTy ->is <ModuleType>()) {
1600
+ if (baseRValueTy ->is <ModuleType>()) {
1601
1601
return getTypeOfReference (value, functionRefInfo, locator, useDC,
1602
1602
preparedOverload);
1603
1603
}
1604
1604
1605
1605
// Check to see if the self parameter is applied, in which case we'll want to
1606
1606
// strip it off later.
1607
- auto hasAppliedSelf = doesMemberRefApplyCurriedSelf (resolvedBaseTy , value);
1607
+ auto hasAppliedSelf = doesMemberRefApplyCurriedSelf (baseRValueTy , value);
1608
1608
1609
- auto baseObjTy = resolvedBaseTy ->getMetatypeInstanceType ();
1609
+ auto baseObjTy = baseRValueTy ->getMetatypeInstanceType ();
1610
1610
FunctionType::Param baseObjParam (baseObjTy);
1611
1611
1612
1612
// Indicates whether this is a valid reference to a static member on a
@@ -1617,7 +1617,7 @@ DeclReferenceType ConstraintSystem::getTypeOfMemberReference(
1617
1617
bool isStaticMemberRefOnProtocol = false ;
1618
1618
if (baseObjTy->isExistentialType () && value->isStatic () &&
1619
1619
locator->isLastElement <LocatorPathElt::UnresolvedMember>()) {
1620
- assert (resolvedBaseTy ->is <MetatypeType>() &&
1620
+ assert (baseRValueTy ->is <MetatypeType>() &&
1621
1621
" Assumed base of unresolved member access must be a metatype" );
1622
1622
isStaticMemberRefOnProtocol = true ;
1623
1623
}
@@ -1846,12 +1846,12 @@ DeclReferenceType ConstraintSystem::getTypeOfMemberReference(
1846
1846
} else if (isa<AbstractFunctionDecl>(value) || isa<EnumElementDecl>(value)) {
1847
1847
unsigned numApplies = getNumApplications (hasAppliedSelf, functionRefInfo);
1848
1848
openedType = adjustFunctionTypeForConcurrency (
1849
- origOpenedType->castTo <FunctionType>(), resolvedBaseTy , value, useDC,
1849
+ origOpenedType->castTo <FunctionType>(), baseRValueTy , value, useDC,
1850
1850
numApplies, isMainDispatchQueueMember (locator), replacements, locator,
1851
1851
preparedOverload);
1852
1852
} else if (auto subscript = dyn_cast<SubscriptDecl>(value)) {
1853
1853
openedType = adjustFunctionTypeForConcurrency (
1854
- origOpenedType->castTo <FunctionType>(), resolvedBaseTy , subscript, useDC,
1854
+ origOpenedType->castTo <FunctionType>(), baseRValueTy , subscript, useDC,
1855
1855
/* numApplies=*/ 2 , /* isMainDispatchQueue=*/ false , replacements, locator,
1856
1856
preparedOverload);
1857
1857
} else if (auto var = dyn_cast<VarDecl>(value)) {
0 commit comments