Skip to content

Commit 7f8c4e0

Browse files
committed
Sema: Correctly thread PreparedOverloadBuilder through InferableTypeOpener
1 parent 9dea725 commit 7f8c4e0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3508,8 +3508,10 @@ void OpenGenericTypeRequirements::operator()(GenericTypeDecl *decl,
35083508
cs.recordOpenedTypes(locator, replacements, preparedOverload,
35093509
/*fixmeAllowDuplicates*/ true);
35103510

3511-
for (auto [gp, typeVar] : replacements)
3512-
cs.addConstraint(ConstraintKind::Bind, typeVar, subst(gp), locator);
3511+
for (auto [gp, typeVar] : replacements) {
3512+
cs.addConstraint(ConstraintKind::Bind, typeVar, subst(gp), locator,
3513+
/*isFavored=*/false, preparedOverload);
3514+
}
35133515

35143516
auto openType = [&](Type ty) -> Type {
35153517
return cs.openType(ty, replacements, locator, preparedOverload);

lib/Sema/TypeOfReference.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,8 @@ class InferableTypeOpener final {
303303
// an invalid AST node.
304304
if (type->hasError()) {
305305
cs.recordFix(
306-
IgnoreInvalidASTNode::create(cs, cs.getConstraintLocator(locator)));
306+
IgnoreInvalidASTNode::create(cs, cs.getConstraintLocator(locator)),
307+
/*impact=*/1, preparedOverload);
307308
}
308309
return type.transformRec([&](Type type) -> std::optional<Type> {
309310
if (!type->hasUnboundGenericType() && !type->hasPlaceholder() &&

0 commit comments

Comments
 (0)