@@ -74,39 +74,21 @@ deriveBodyComparable_enum_noAssociatedValues_lt(AbstractFunctionDecl *ltDecl,
74
74
FuncDecl *cmpFunc = C.getLessThanIntDecl ();
75
75
assert (cmpFunc && " should have a < for int as we already checked for it" );
76
76
77
- auto fnType = cmpFunc->getInterfaceType ()->castTo <FunctionType>();
78
-
79
- Expr *cmpFuncExpr;
80
- if (cmpFunc->getDeclContext ()->isTypeContext ()) {
81
- auto contextTy = cmpFunc->getDeclContext ()->getSelfInterfaceType ();
82
- Expr *base = TypeExpr::createImplicitHack (SourceLoc (), contextTy, C);
83
- Expr *ref = new (C) DeclRefExpr (cmpFunc, DeclNameLoc (), /* Implicit*/ true ,
84
- AccessSemantics::Ordinary, fnType);
85
-
86
- fnType = fnType->getResult ()->castTo <FunctionType>();
87
- cmpFuncExpr = new (C) DotSyntaxCallExpr (ref, SourceLoc (), base, fnType);
88
- cmpFuncExpr->setImplicit ();
89
- } else {
90
- cmpFuncExpr = new (C) DeclRefExpr (cmpFunc, DeclNameLoc (),
91
- /* implicit*/ true ,
92
- AccessSemantics::Ordinary,
93
- fnType);
94
- }
77
+ Expr *cmpFuncExpr = new (C) DeclRefExpr (cmpFunc, DeclNameLoc (),
78
+ /* implicit*/ true ,
79
+ AccessSemantics::Ordinary);
95
80
96
- TupleTypeElt abTupleElts[2 ] = { aIndex->getType (), bIndex->getType () };
97
81
TupleExpr *abTuple = TupleExpr::create (C, SourceLoc (), { aIndex, bIndex },
98
82
{ }, { }, SourceLoc (),
99
83
/* HasTrailingClosure*/ false ,
100
- /* Implicit*/ true ,
101
- TupleType::get (abTupleElts, C));
84
+ /* Implicit*/ true );
102
85
103
86
auto *cmpExpr = new (C) BinaryExpr (
104
- cmpFuncExpr, abTuple, /* implicit*/ true ,
105
- fnType->castTo <FunctionType>()->getResult ());
87
+ cmpFuncExpr, abTuple, /* implicit*/ true );
106
88
statements.push_back (new (C) ReturnStmt (SourceLoc (), cmpExpr));
107
89
108
90
BraceStmt *body = BraceStmt::create (C, SourceLoc (), statements, SourceLoc ());
109
- return { body, /* isTypeChecked=*/ true };
91
+ return { body, /* isTypeChecked=*/ false };
110
92
}
111
93
112
94
// / Derive the body for an '==' operator for an enum where at least one of the
0 commit comments