@@ -1858,7 +1858,7 @@ static FunctionType *applyOptionality(ValueDecl *value, FunctionType *fnTy) {
1858
1858
std::pair<Type, Type>
1859
1859
ConstraintSystem::getTypeOfMemberReferenceImpl (
1860
1860
OverloadChoice choice, DeclContext *useDC,
1861
- ConstraintLocator *locator, SmallVectorImpl<OpenedType> *replacementsPtr,
1861
+ ConstraintLocator *locator,
1862
1862
PreparedOverloadBuilder *preparedOverload) {
1863
1863
ASSERT (!!preparedOverload == PreparingOverload);
1864
1864
@@ -1888,28 +1888,23 @@ ConstraintSystem::getTypeOfMemberReferenceImpl(
1888
1888
auto genericSig = innerDC->getGenericSignatureOfContext ();
1889
1889
1890
1890
// Open the type of the generic function or member of a generic type.
1891
- ArrayRef<OpenedType> replacements;
1892
- SmallVector<OpenedType, 4 > localReplacements;
1893
- {
1894
- auto &_replacements = replacementsPtr ? *replacementsPtr : localReplacements;
1895
-
1896
- // If we have a generic signature, open the parameters. We delay opening
1897
- // requirements to allow contextual types to affect the situation.
1898
- if (genericSig) {
1899
- openGenericParameters (outerDC, genericSig, _replacements, locator,
1900
- preparedOverload);
1901
- }
1891
+ SmallVector<OpenedType, 4 > replacements;
1902
1892
1903
- // If we opened up any type variables, record the replacements. We do this
1904
- // up-front to allow requirement fix coalescing logic to work correctly with
1905
- // requirements imposed on base type (since that relies on being able to
1906
- // find the recorded opened type). We then make the array immutable for the
1907
- // following logic to ensure they don't attempt to add any additional opened
1908
- // types.
1909
- recordOpenedTypes (locator, _replacements, preparedOverload);
1910
- replacements = _replacements;
1893
+ // If we have a generic signature, open the parameters. We delay opening
1894
+ // requirements to allow contextual types to affect the situation.
1895
+ if (genericSig) {
1896
+ openGenericParameters (outerDC, genericSig, replacements, locator,
1897
+ preparedOverload);
1911
1898
}
1912
1899
1900
+ // If we opened up any type variables, record the replacements. We do this
1901
+ // up-front to allow requirement fix coalescing logic to work correctly with
1902
+ // requirements imposed on base type (since that relies on being able to
1903
+ // find the recorded opened type). We then make the array immutable for the
1904
+ // following logic to ensure they don't attempt to add any additional opened
1905
+ // types.
1906
+ recordOpenedTypes (locator, replacements, preparedOverload);
1907
+
1913
1908
// Check to see if the self parameter is applied, in which case we'll want to
1914
1909
// strip it off later.
1915
1910
auto hasAppliedSelf = doesMemberRefApplyCurriedSelf (baseRValueTy, value);
@@ -2039,7 +2034,6 @@ ConstraintSystem::getTypeOfMemberReferenceImpl(
2039
2034
2040
2035
DeclReferenceType ConstraintSystem::getTypeOfMemberReference (
2041
2036
OverloadChoice choice, DeclContext *useDC, ConstraintLocator *locator,
2042
- SmallVectorImpl<OpenedType> *replacementsPtr,
2043
2037
PreparedOverloadBuilder *preparedOverload) {
2044
2038
ASSERT (!!preparedOverload == PreparingOverload);
2045
2039
@@ -2056,8 +2050,7 @@ DeclReferenceType ConstraintSystem::getTypeOfMemberReference(
2056
2050
2057
2051
Type openedType, thrownErrorType;
2058
2052
std::tie (openedType, thrownErrorType)
2059
- = getTypeOfMemberReferenceImpl (choice, useDC, locator, replacementsPtr,
2060
- preparedOverload);
2053
+ = getTypeOfMemberReferenceImpl (choice, useDC, locator, preparedOverload);
2061
2054
2062
2055
if (isa<TypeDecl>(value)) {
2063
2056
auto type = openedType->castTo <FunctionType>()->getResult ();
@@ -2852,11 +2845,9 @@ ConstraintSystem::prepareOverloadImpl(ConstraintLocator *locator,
2852
2845
return getTypeOfReference (choice, locator, useDC, preparedOverload);
2853
2846
}
2854
2847
2855
- return getTypeOfMemberReference (
2856
- choice, useDC, locator, /* replacements=*/ nullptr , preparedOverload);
2848
+ return getTypeOfMemberReference (choice, useDC, locator, preparedOverload);
2857
2849
} else {
2858
- return getTypeOfReference (
2859
- choice, locator, useDC, preparedOverload);
2850
+ return getTypeOfReference (choice, locator, useDC, preparedOverload);
2860
2851
}
2861
2852
}
2862
2853
0 commit comments