Skip to content

Commit e3bb2be

Browse files
committed
Prevent potential bindings to ErrorType
1 parent 6a47d02 commit e3bb2be

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/Sema/CSBindings.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ ConstraintSystem::getPotentialBindings(TypeVariableType *typeVar) {
148148
// coalescing supertype bounds when we are able to compute the meet.
149149
auto addPotentialBinding = [&](PotentialBinding binding,
150150
bool allowJoinMeet = true) {
151+
assert(!binding.BindingType->is<ErrorType>());
151152
// If this is a non-defaulted supertype binding, check whether we can
152153
// combine it with another supertype binding by computing the 'join' of the
153154
// types.
@@ -374,6 +375,10 @@ ConstraintSystem::getPotentialBindings(TypeVariableType *typeVar) {
374375
result.InvolvesTypeVariables = true;
375376
continue;
376377
}
378+
379+
// Do not attempt to bind to ErrorType.
380+
if (type->hasError())
381+
continue;
377382

378383
// If the type we'd be binding to is a dependent member, don't try to
379384
// resolve this type variable yet.

0 commit comments

Comments
 (0)