mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[ConstraintSystem] Make sure that invalid state is always diagnosed via fallback diagnostic
This commit is contained in:
@@ -5472,6 +5472,14 @@ void ConstraintSystem::diagnoseFailureFor(SolutionApplicationTarget target) {
|
||||
SWIFT_DEFER { setPhase(ConstraintSystemPhase::Finalization); };
|
||||
|
||||
auto &DE = getASTContext().Diags;
|
||||
|
||||
// If constraint system is in invalid state always produce
|
||||
// a fallback diagnostic that asks to file a bug.
|
||||
if (inInvalidState()) {
|
||||
DE.diagnose(target.getLoc(), diag::failed_to_produce_diagnostic);
|
||||
return;
|
||||
}
|
||||
|
||||
if (auto expr = target.getAsExpr()) {
|
||||
if (auto *assignment = dyn_cast<AssignExpr>(expr)) {
|
||||
if (isa<DiscardAssignmentExpr>(assignment->getDest()))
|
||||
|
||||
Reference in New Issue
Block a user