Skip to content

Commit 9b6ecf9

Browse files
committed
[CSBindings] Fix early return condition in TypeVariableBinding::attempt
When `reportHole()` returns `true` it indicates a failure and `attempt` has to return `false` right away.
1 parent 6f78e21 commit 9b6ecf9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Sema/CSBindings.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2208,8 +2208,9 @@ bool TypeVariableBinding::attempt(ConstraintSystem &cs) const {
22082208
if (Binding.isDefaultableBinding()) {
22092209
cs.DefaultedConstraints.insert(srcLocator);
22102210

2211+
// Fail if hole reporting fails.
22112212
if (type->isPlaceholder() && reportHole())
2212-
return true;
2213+
return false;
22132214
}
22142215

22152216
if (cs.simplify())

0 commit comments

Comments
 (0)