File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1558,9 +1558,11 @@ bool IgnoreInvalidFunctionBuilderBody::diagnose(const Solution &solution,
1558
1558
1559
1559
class PreCheckWalker : public ASTWalker {
1560
1560
DeclContext *DC;
1561
+ DiagnosticTransaction Transaction;
1561
1562
1562
1563
public:
1563
- PreCheckWalker (DeclContext *dc) : DC(dc) {}
1564
+ PreCheckWalker (DeclContext *dc)
1565
+ : DC(dc), Transaction(dc->getASTContext ().Diags) {}
1564
1566
1565
1567
std::pair<bool , Expr *> walkToExprPre (Expr *E) override {
1566
1568
auto hasError = ConstraintSystem::preCheckExpression (
@@ -1576,12 +1578,16 @@ bool IgnoreInvalidFunctionBuilderBody::diagnose(const Solution &solution,
1576
1578
std::pair<bool , Pattern *> walkToPatternPre (Pattern *P) override {
1577
1579
return std::make_pair (false , P);
1578
1580
}
1581
+
1582
+ bool diagnosed () const {
1583
+ return Transaction.hasDiagnostics ();
1584
+ }
1579
1585
};
1580
1586
1581
1587
PreCheckWalker walker (solution.getDC());
1582
1588
S->walk (walker);
1583
1589
1584
- return true ;
1590
+ return walker.diagnosed() ;
1585
1591
}
1586
1592
1587
1593
IgnoreInvalidFunctionBuilderBody *
You can’t perform that action at this time.
0 commit comments