@@ -1628,8 +1628,8 @@ std::pair<Type, Type> ConstraintSystem::getOpenedStorageType(
1628
1628
FunctionType::Param selfParam (selfTy, Identifier (), selfFlags);
1629
1629
1630
1630
FunctionType::ExtInfo info;
1631
- return std::make_pair (thrownErrorType ,
1632
- FunctionType::get ({selfParam}, refType, info) );
1631
+ return std::make_pair (FunctionType::get ({selfParam}, refType, info) ,
1632
+ thrownErrorType );
1633
1633
}
1634
1634
1635
1635
// / Add the constraint on the type used for the 'Self' type for a member
@@ -1855,7 +1855,7 @@ static FunctionType *applyOptionality(ValueDecl *value, FunctionType *fnTy) {
1855
1855
fnTy->getExtInfo ());
1856
1856
}
1857
1857
1858
- std::tuple<Type, Type, Type>
1858
+ std::pair< Type, Type>
1859
1859
ConstraintSystem::getTypeOfMemberReferenceImpl (
1860
1860
OverloadChoice choice, DeclContext *useDC,
1861
1861
ConstraintLocator *locator, SmallVectorImpl<OpenedType> *replacementsPtr,
@@ -1878,7 +1878,7 @@ ConstraintSystem::getTypeOfMemberReferenceImpl(
1878
1878
if (auto *typeDecl = dyn_cast<TypeDecl>(value)) {
1879
1879
openedType = getTypeOfMemberTypeReference (baseObjTy, typeDecl,
1880
1880
locator, preparedOverload);
1881
- return {openedType, thrownErrorType, baseObjTy };
1881
+ return {openedType, thrownErrorType};
1882
1882
}
1883
1883
1884
1884
// Figure out the declaration context to use when opening this type.
@@ -1919,7 +1919,7 @@ ConstraintSystem::getTypeOfMemberReferenceImpl(
1919
1919
isa<MacroDecl>(value)) {
1920
1920
auto interfaceType = value->getInterfaceType ();
1921
1921
if (interfaceType->is <ErrorType>() || isa<MacroDecl>(value))
1922
- return { interfaceType, Type (), baseObjTy };
1922
+ return { interfaceType, Type () };
1923
1923
1924
1924
if (outerDC->getSelfClassDecl ()) {
1925
1925
if (isa<ConstructorDecl>(value)) {
@@ -1939,7 +1939,7 @@ ConstraintSystem::getTypeOfMemberReferenceImpl(
1939
1939
} else {
1940
1940
auto *storage = cast<AbstractStorageDecl>(value);
1941
1941
1942
- std::tie (thrownErrorType, openedType ) = getOpenedStorageType (
1942
+ std::tie (openedType, thrownErrorType ) = getOpenedStorageType (
1943
1943
baseTy, storage, useDC, hasAppliedSelf, replacements, locator,
1944
1944
preparedOverload);
1945
1945
}
@@ -1976,7 +1976,6 @@ ConstraintSystem::getTypeOfMemberReferenceImpl(
1976
1976
// to make sure that it's opened before use.
1977
1977
baseOpenedTy = openType (concreteSelf, replacements, locator,
1978
1978
preparedOverload);
1979
- baseObjTy = baseOpenedTy;
1980
1979
}
1981
1980
}
1982
1981
} else {
@@ -2035,7 +2034,7 @@ ConstraintSystem::getTypeOfMemberReferenceImpl(
2035
2034
}
2036
2035
}
2037
2036
2038
- return { openedType, thrownErrorType, baseObjTy };
2037
+ return { openedType, thrownErrorType };
2039
2038
}
2040
2039
2041
2040
DeclReferenceType ConstraintSystem::getTypeOfMemberReference (
@@ -2047,15 +2046,16 @@ DeclReferenceType ConstraintSystem::getTypeOfMemberReference(
2047
2046
auto *value = choice.getDecl ();
2048
2047
2049
2048
// Figure out the instance type used for the base.
2050
- Type baseRValueTy = choice.getBaseType ();
2049
+ Type baseTy = choice.getBaseType ();
2050
+ Type baseRValueTy = baseTy->getRValueType ();
2051
2051
Type baseObjTy = baseRValueTy->getMetatypeInstanceType ();
2052
2052
2053
2053
// A reference to a module member is really unqualified, and should
2054
2054
// be handled by the caller via getTypeOfReference().
2055
2055
ASSERT (!baseObjTy->is <ModuleType>());
2056
2056
2057
2057
Type openedType, thrownErrorType;
2058
- std::tie (openedType, thrownErrorType, baseObjTy )
2058
+ std::tie (openedType, thrownErrorType)
2059
2059
= getTypeOfMemberReferenceImpl (choice, useDC, locator, replacementsPtr,
2060
2060
preparedOverload);
2061
2061
0 commit comments