Skip to content

Commit d0016bf

Browse files
committed
Fix assertion failure in validation test
Seen in validation-test/IDE/crashers_fixed/019-swift-vardecl-emitlettovarnoteifsimple.swift
1 parent 92f7e0a commit d0016bf

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
@@ -2073,7 +2073,8 @@ bool MissingArgumentsFailure::diagnoseAsError() {
20732073
auto path = locator->getPath();
20742074

20752075
// TODO: Currently this is only intended to diagnose contextual failures.
2076-
if (!(path.back().getKind() == ConstraintLocator::ApplyArgToParam ||
2076+
if (path.empty() ||
2077+
!(path.back().getKind() == ConstraintLocator::ApplyArgToParam ||
20772078
path.back().getKind() == ConstraintLocator::ContextualType))
20782079
return false;
20792080

0 commit comments

Comments
 (0)