Skip to content

Commit 2b5a8a5

Browse files
committed
Fix assertion failure in validation test
Seen in validation-test/IDE/crashers_fixed/019-swift-vardecl-emitlettovarnoteifsimple.swift
1 parent f8a3afb commit 2b5a8a5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Sema/CSDiagnostics.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1976,7 +1976,8 @@ bool MissingArgumentsFailure::diagnoseAsError() {
19761976
auto path = locator->getPath();
19771977

19781978
// TODO: Currently this is only intended to diagnose contextual failures.
1979-
if (!(path.back().getKind() == ConstraintLocator::ApplyArgToParam ||
1979+
if (path.empty() ||
1980+
!(path.back().getKind() == ConstraintLocator::ApplyArgToParam ||
19801981
path.back().getKind() == ConstraintLocator::ContextualType))
19811982
return false;
19821983

0 commit comments

Comments
 (0)