Skip to content

Commit 9913f8d

Browse files
committed
[Diagnostics] NFC: Use isLastElement API instead of checking locator path
1 parent 2a0080c commit 9913f8d

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

lib/Sema/CSDiagnostics.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,12 +1363,8 @@ class ExtraneousArgumentsFailure final : public FailureDiagnostic {
13631363

13641364
bool isContextualMismatch() const {
13651365
auto *locator = getLocator();
1366-
auto path = locator->getPath();
1367-
1368-
assert(!path.empty());
1369-
const auto &last = path.back();
1370-
return last.getKind() == ConstraintLocator::ContextualType ||
1371-
last.getKind() == ConstraintLocator::ApplyArgToParam;
1366+
return locator->isLastElement<LocatorPathElt::ContextualType>() ||
1367+
locator->isLastElement<LocatorPathElt::ApplyArgToParam>();
13721368
}
13731369
};
13741370

0 commit comments

Comments
 (0)