mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Sema] Do not consider warning fixes for non-augmenting fix recording logic
This commit is contained in:
@@ -11661,9 +11661,16 @@ bool ConstraintSystem::recordFix(ConstraintFix *fix, unsigned impact) {
|
||||
// current anchor or, in case of anchor being an expression, any of
|
||||
// its sub-expressions.
|
||||
llvm::SmallDenseSet<ASTNode> anchors;
|
||||
for (const auto *fix : Fixes)
|
||||
anchors.insert(fix->getAnchor());
|
||||
for (const auto *fix : Fixes) {
|
||||
// Warning fixes shouldn't be considered, because even if
|
||||
// such fix is recorded at that anchor this should not
|
||||
// have any affect in the recording of any other fix.
|
||||
if (fix->isWarning())
|
||||
continue;
|
||||
|
||||
anchors.insert(fix->getAnchor());
|
||||
}
|
||||
|
||||
bool found = false;
|
||||
if (auto *expr = getAsExpr(anchor)) {
|
||||
forEachExpr(expr, [&](Expr *subExpr) -> Expr * {
|
||||
|
||||
Reference in New Issue
Block a user