Skip to content

Commit be99082

Browse files
committed
[Constraint] Disable "fixed" overload choice by default
1 parent bdf21be commit be99082

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/Sema/Constraint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Constraint::Constraint(Type type, OverloadChoice choice, DeclContext *useDC,
169169
ConstraintFix *fix, ConstraintLocator *locator,
170170
ArrayRef<TypeVariableType *> typeVars)
171171
: Kind(ConstraintKind::BindOverload), TheFix(fix), HasRestriction(false),
172-
IsActive(false), IsDisabled(false), RememberChoice(false),
172+
IsActive(false), IsDisabled(bool(fix)), RememberChoice(false),
173173
IsFavored(false),
174174
NumTypeVariables(typeVars.size()), Overload{type, choice, useDC},
175175
Locator(locator) {

lib/Sema/Constraint.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ class Constraint final : public llvm::ilist_node<Constraint>,
401401
ConstraintLocator *locator);
402402

403403
/// Create a bind overload choice with a fix.
404+
/// Note: This constraint is going to be disabled by default.
404405
static Constraint *createFixedChoice(ConstraintSystem &cs, Type type,
405406
OverloadChoice choice,
406407
DeclContext *useDC, ConstraintFix *fix,

0 commit comments

Comments
 (0)