Skip to content

Commit bdf21be

Browse files
committed
[ConstraintSystem] NFC: Add hasFix() to DisjunctionChoice
1 parent dee8d7b commit bdf21be

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2525,10 +2525,9 @@ void ConstraintSystem::generateConstraints(
25252525
}
25262526

25272527
for (auto index : indices(choices)) {
2528-
const auto &choice = choices[index];
25292528
if (favoredIndex && (*favoredIndex == index))
25302529
continue;
25312530

2532-
recordChoice(constraints, index, choice);
2531+
recordChoice(constraints, index, choices[index]);
25332532
}
25342533
}

lib/Sema/ConstraintSystem.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2474,7 +2474,7 @@ class ConstraintSystem {
24742474
/// \param requiresFix Determines whether choices require a fix to
24752475
/// be included in the result. If the fix couldn't be provided by
24762476
/// `getFix` for any given choice, such choice would be filtered out.
2477-
////
2477+
///
24782478
/// \param getFix Optional callback to determine a fix for a given
24792479
/// choice (first argument is a position of current choice,
24802480
/// second - the choice in question).
@@ -3678,6 +3678,10 @@ class DisjunctionChoice {
36783678

36793679
bool isDisabled() const { return Choice->isDisabled(); }
36803680

3681+
bool hasFix() const {
3682+
return bool(Choice->getFix());
3683+
}
3684+
36813685
bool isUnavailable() const {
36823686
if (auto *decl = getDecl(Choice))
36833687
return decl->getAttrs().isUnavailable(decl->getASTContext());

0 commit comments

Comments
 (0)