Skip to content

Commit 967f99f

Browse files
committed
[NFC] Sema: Remove unused generic parameter result from canOpenExistentialCallArgument
1 parent 97a59c1 commit 967f99f

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,8 +1441,8 @@ class AllowLabelMismatches : public MatchCallArgumentListener {
14411441
}
14421442
};
14431443

1444-
static std::optional<std::tuple<GenericTypeParamType *, TypeVariableType *,
1445-
Type, OpenedExistentialAdjustments>>
1444+
static std::optional<
1445+
std::tuple<TypeVariableType *, Type, OpenedExistentialAdjustments>>
14461446
shouldOpenExistentialCallArgument(ValueDecl *callee, unsigned paramIdx,
14471447
Type paramTy, Type argTy, Expr *argExpr,
14481448
ConstraintSystem &cs) {
@@ -1819,12 +1819,10 @@ static ConstraintSystem::TypeMatchResult matchCallArguments(
18191819
if (auto existentialArg = shouldOpenExistentialCallArgument(
18201820
callee, paramIdx, paramTy, argTy, argExpr, cs)) {
18211821
// My kingdom for a decent "if let" in C++.
1822-
GenericTypeParamType *openedGenericParam;
18231822
TypeVariableType *openedTypeVar;
18241823
Type existentialType;
18251824
OpenedExistentialAdjustments adjustments;
1826-
std::tie(openedGenericParam, openedTypeVar, existentialType,
1827-
adjustments) = *existentialArg;
1825+
std::tie(openedTypeVar, existentialType, adjustments) = *existentialArg;
18281826

18291827
OpenedArchetypeType *opened;
18301828
std::tie(argTy, opened) = cs.openExistentialType(

lib/Sema/OpenedExistentials.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -590,10 +590,10 @@ swift::isMemberAvailableOnExistential(Type baseTy, const ValueDecl *member) {
590590
return result;
591591
}
592592

593-
std::optional<std::tuple<GenericTypeParamType *, TypeVariableType *,
594-
Type, OpenedExistentialAdjustments>>
593+
std::optional<
594+
std::tuple<TypeVariableType *, Type, OpenedExistentialAdjustments>>
595595
swift::canOpenExistentialCallArgument(ValueDecl *callee, unsigned paramIdx,
596-
Type paramTy, Type argTy) {
596+
Type paramTy, Type argTy) {
597597
if (!callee)
598598
return std::nullopt;
599599

@@ -728,7 +728,7 @@ swift::canOpenExistentialCallArgument(ValueDecl *callee, unsigned paramIdx,
728728
if (referenceInfo.hasNonCovariantRef())
729729
return std::nullopt;
730730

731-
return std::make_tuple(genericParam, paramTypeVar, argTy, adjustments);
731+
return std::make_tuple(paramTypeVar, argTy, adjustments);
732732
}
733733

734734
/// For each occurrence of a type **type** in `refTy` that satisfies

lib/Sema/OpenedExistentials.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ using OpenedExistentialAdjustments =
154154
/// \param argTy The type of the argument.
155155
///
156156
/// \returns If the argument type is existential and opening it can bind a
157-
/// generic parameter in the callee, returns the generic parameter, type
158-
/// variable (from the opened parameter type) the existential type that needs
159-
/// to be opened (from the argument type), and the adjustments that need to be
160-
/// applied to the existential type after it is opened.
161-
std::optional<std::tuple<GenericTypeParamType *, TypeVariableType *,
162-
Type, OpenedExistentialAdjustments>>
157+
/// generic parameter in the callee, returns the type variable (from the opened
158+
/// parameter type) the existential type that needs to be opened (from the
159+
/// argument type), and the adjustments that need to be applied to the
160+
/// existential type after it is opened.
161+
std::optional<
162+
std::tuple<TypeVariableType *, Type, OpenedExistentialAdjustments>>
163163
canOpenExistentialCallArgument(ValueDecl *callee, unsigned paramIdx,
164164
Type paramTy, Type argTy);
165165

0 commit comments

Comments
 (0)