File tree Expand file tree Collapse file tree 3 files changed +240
-215
lines changed Expand file tree Collapse file tree 3 files changed +240
-215
lines changed Original file line number Diff line number Diff line change @@ -1350,10 +1350,6 @@ class alignas(1 << TypeAlignInBits) TypeBase
13501350 // / Hack to deal with ConstructorDecl interface types.
13511351 Type withCovariantResultType ();
13521352
1353- // / Deprecated in favor of the above.
1354- Type replaceCovariantResultType (Type newResultType,
1355- unsigned uncurryLevel);
1356-
13571353 // / Returns a new function type exactly like this one but with the self
13581354 // / parameter replaced. Only makes sense for function members of types.
13591355 Type replaceSelfParameterType (Type newSelf);
Original file line number Diff line number Diff line change @@ -1393,37 +1393,6 @@ Type TypeBase::withCovariantResultType() {
13931393 fnType->getExtInfo ());
13941394}
13951395
1396- Type TypeBase::replaceCovariantResultType (Type newResultType,
1397- unsigned uncurryLevel) {
1398- if (uncurryLevel == 0 ) {
1399- bool isLValue = is<LValueType>();
1400-
1401- auto loadedTy = getWithoutSpecifierType ();
1402- if (auto objectType = loadedTy->getOptionalObjectType ()) {
1403- newResultType = OptionalType::get (
1404- objectType->replaceCovariantResultType (newResultType, uncurryLevel));
1405- }
1406-
1407- return isLValue ? LValueType::get (newResultType) : newResultType;
1408- }
1409-
1410- // Determine the input and result types of this function.
1411- auto fnType = this ->castTo <AnyFunctionType>();
1412- auto inputType = fnType->getParams ();
1413- Type resultType =
1414- fnType->getResult ()->replaceCovariantResultType (newResultType,
1415- uncurryLevel - 1 );
1416-
1417- // Produce the resulting function type.
1418- if (auto genericFn = dyn_cast<GenericFunctionType>(fnType)) {
1419- return GenericFunctionType::get (genericFn->getGenericSignature (),
1420- inputType, resultType,
1421- fnType->getExtInfo ());
1422- }
1423-
1424- return FunctionType::get (inputType, resultType, fnType->getExtInfo ());
1425- }
1426-
14271396// / Whether this parameter accepts an unlabeled trailing closure argument
14281397// / using the more-restrictive forward-scan rule.
14291398static bool allowsUnlabeledTrailingClosureParameter (const ParamDecl *param) {
You can’t perform that action at this time.
0 commit comments