File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -1448,18 +1448,23 @@ ConstraintSystem::solve(SyntacticElementTarget &target,
1448
1448
return None;
1449
1449
}
1450
1450
1451
- case SolutionResult::Ambiguous:
1452
- // If salvaging produced an ambiguous result, it has already been
1453
- // diagnosed.
1451
+ case SolutionResult::Ambiguous: {
1454
1452
// If we have found an ambiguous solution in the first stage, salvaging
1455
1453
// won't produce more solutions, so we can inform the solution callback
1456
1454
// about the current ambiguous solutions straight away.
1457
- if (stage == 1 || Context.SolutionCallback ) {
1455
+ if (Context.SolutionCallback ) {
1458
1456
reportSolutionsToSolutionCallback (solution);
1459
1457
solution.markAsDiagnosed ();
1460
1458
return None;
1461
1459
}
1462
1460
1461
+ // If salvaging produced an ambiguous result, it has already been
1462
+ // diagnosed.
1463
+ if (stage == 1 ) {
1464
+ solution.markAsDiagnosed ();
1465
+ return None;
1466
+ }
1467
+
1463
1468
if (Options.contains (
1464
1469
ConstraintSystemFlags::AllowUnresolvedTypeVariables)) {
1465
1470
dumpSolutions (solution);
@@ -1471,6 +1476,7 @@ ConstraintSystem::solve(SyntacticElementTarget &target,
1471
1476
}
1472
1477
1473
1478
LLVM_FALLTHROUGH;
1479
+ }
1474
1480
1475
1481
case SolutionResult::UndiagnosedError:
1476
1482
// / If we have a SolutionCallback, we are inspecting constraint system
You can’t perform that action at this time.
0 commit comments