@@ -381,17 +381,23 @@ deriveBodyEquatable_enum_uninhabited_eq(AbstractFunctionDecl *eqDecl, void *) {
381
381
SmallVector<ASTNode, 0 > cases;
382
382
383
383
// switch (a, b) { }
384
- auto aRef = new (C) DeclRefExpr (aParam, DeclNameLoc (), /* implicit*/ true );
385
- auto bRef = new (C) DeclRefExpr (bParam, DeclNameLoc (), /* implicit*/ true );
384
+ auto aRef = new (C) DeclRefExpr (aParam, DeclNameLoc (), /* implicit*/ true ,
385
+ AccessSemantics::Ordinary,
386
+ aParam->getType ());
387
+ auto bRef = new (C) DeclRefExpr (bParam, DeclNameLoc (), /* implicit*/ true ,
388
+ AccessSemantics::Ordinary,
389
+ bParam->getType ());
390
+ TupleTypeElt abTupleElts[2 ] = { aParam->getType (), bParam->getType () };
386
391
auto abExpr = TupleExpr::create (C, SourceLoc (), {aRef, bRef}, {}, {},
387
392
SourceLoc (), /* HasTrailingClosure*/ false ,
388
- /* implicit*/ true );
393
+ /* implicit*/ true ,
394
+ TupleType::get (abTupleElts, C));
389
395
auto switchStmt = SwitchStmt::create (LabeledStmtInfo (), SourceLoc (), abExpr,
390
396
SourceLoc (), cases, SourceLoc (), C);
391
397
statements.push_back (switchStmt);
392
398
393
399
auto body = BraceStmt::create (C, SourceLoc (), statements, SourceLoc ());
394
- return { body, /* isTypeChecked=*/ false };
400
+ return { body, /* isTypeChecked=*/ true };
395
401
}
396
402
397
403
// / Derive the body for an '==' operator for an enum that has no associated
0 commit comments