Skip to content

Commit f856766

Browse files
authored
Merge pull request swiftlang#9132 from rudkx/let-the-type-checker-do-its-job
2 parents ff544cc + 9e38a8e commit f856766

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/Sema/DerivedConformanceEquatableHashable.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ static void deriveBodyEquatable_enum_eq(AbstractFunctionDecl *eqDecl) {
140140
auto aParam = args->get(0);
141141
auto bParam = args->get(1);
142142

143-
auto boolTy = C.getBoolDecl()->getDeclaredType();
144-
145143
auto enumDecl = cast<EnumDecl>(aParam->getType()->getAnyNominal());
146144

147145
// Generate the conversion from the enums to integer indices.
@@ -181,8 +179,7 @@ static void deriveBodyEquatable_enum_eq(AbstractFunctionDecl *eqDecl) {
181179
/*HasTrailingClosure*/ false,
182180
/*Implicit*/ true, tType);
183181

184-
auto *cmpExpr = new (C) BinaryExpr(cmpFuncExpr, abTuple, /*implicit*/ true,
185-
boolTy);
182+
auto *cmpExpr = new (C) BinaryExpr(cmpFuncExpr, abTuple, /*implicit*/ true);
186183
statements.push_back(new (C) ReturnStmt(SourceLoc(), cmpExpr));
187184

188185
BraceStmt *body = BraceStmt::create(C, SourceLoc(), statements, SourceLoc());

0 commit comments

Comments
 (0)