Skip to content

Commit 501cd91

Browse files
committed
Sema: Add additional assertion before providing keypath application diagnostic
1 parent ed3eaef commit 501cd91

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/Sema/CSDiagnostics.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,7 @@ bool AssignmentFailure::diagnoseAsError() {
989989
auto getKeyPathArgument = [](SubscriptExpr *expr) {
990990
auto *TE = dyn_cast<TupleExpr>(expr->getIndex());
991991
assert(TE->getNumElements() == 1);
992+
assert(TE->getElementName(0).str() == "keyPath");
992993
return TE->getElement(0);
993994
};
994995

0 commit comments

Comments
 (0)