Skip to content

Commit 8773f21

Browse files
committed
Replaced an if statement with an assertion in SILGenExpr
1 parent 85df714 commit 8773f21

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/SILGen/SILGenExpr.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3577,9 +3577,7 @@ SILGenModule::emitKeyPathComponentForDecl(SILLocation loc,
35773577
KeyPathPatternComponent
35783578
SILGenModule::emitKeyPathComponentForTupleElement(unsigned tupleIndex,
35793579
CanType baseTy) {
3580-
if (!baseTy->is<TupleType>()) {
3581-
llvm_unreachable("baseTy is expected to be a TupleType");
3582-
}
3580+
assert(baseTy->is<TupleType>() && "baseTy is expected to be a TupleType");
35833581

35843582
auto elementTy = baseTy->getAs<TupleType>()
35853583
->getElementType(tupleIndex)

0 commit comments

Comments
 (0)