@@ -79,7 +79,9 @@ void ConnectedComponent::buildRequirements(Type subjectType,
79
79
subjectType, constraintType);
80
80
subjectType = constraintType;
81
81
}
82
- } else {
82
+ } else if (!ConcreteType->hasError ()) {
83
+ // For compatibility with the old GenericSignatureBuilder, drop requirements
84
+ // containing ErrorTypes.
83
85
reqs.emplace_back (RequirementKind::SameType,
84
86
subjectType, ConcreteType);
85
87
@@ -120,14 +122,20 @@ RequirementMachine::buildRequirementsFromRules(
120
122
prop->getLayoutConstraint ());
121
123
return ;
122
124
123
- case Symbol::Kind::Superclass:
125
+ case Symbol::Kind::Superclass: {
126
+ // For compatibility with the old GenericSignatureBuilder, drop requirements
127
+ // containing ErrorTypes.
128
+ auto superclassType = Context.getTypeFromSubstitutionSchema (
129
+ prop->getSuperclass (),
130
+ prop->getSubstitutions (),
131
+ genericParams, MutableTerm ());
132
+ if (superclassType->hasError ())
133
+ return ;
134
+
124
135
reqs.emplace_back (RequirementKind::Superclass,
125
- subjectType,
126
- Context.getTypeFromSubstitutionSchema (
127
- prop->getSuperclass (),
128
- prop->getSubstitutions (),
129
- genericParams, MutableTerm ()));
136
+ subjectType, superclassType);
130
137
return ;
138
+ }
131
139
132
140
case Symbol::Kind::ConcreteType: {
133
141
auto concreteType = Context.getTypeFromSubstitutionSchema (
0 commit comments