We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
isLastElement
1 parent 2a0080c commit 9913f8dCopy full SHA for 9913f8d
lib/Sema/CSDiagnostics.h
@@ -1363,12 +1363,8 @@ class ExtraneousArgumentsFailure final : public FailureDiagnostic {
1363
1364
bool isContextualMismatch() const {
1365
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;
+ return locator->isLastElement<LocatorPathElt::ContextualType>() ||
+ locator->isLastElement<LocatorPathElt::ApplyArgToParam>();
1372
}
1373
};
1374
0 commit comments