@@ -1710,7 +1710,7 @@ bool EquivalenceClass::recordConformanceConstraint(
1710
1710
GenericSignatureBuilder &builder,
1711
1711
ResolvedType type,
1712
1712
ProtocolDecl *proto,
1713
- FloatingRequirementSource source) {
1713
+ const RequirementSource * source) {
1714
1714
// If we haven't seen a conformance to this protocol yet, add it.
1715
1715
bool inserted = false ;
1716
1716
auto known = conformsTo.find (proto);
@@ -1730,8 +1730,7 @@ bool EquivalenceClass::recordConformanceConstraint(
1730
1730
}
1731
1731
1732
1732
// Record this conformance source.
1733
- known->second .push_back ({type.getUnresolvedType (), proto,
1734
- source.getSource (builder, type)});
1733
+ known->second .push_back ({type.getUnresolvedType (), proto, source});
1735
1734
++NumConformanceConstraints;
1736
1735
1737
1736
return inserted;
@@ -4167,13 +4166,15 @@ ConstraintResult GenericSignatureBuilder::addConformanceRequirement(
4167
4166
ResolvedType type,
4168
4167
ProtocolDecl *proto,
4169
4168
FloatingRequirementSource source) {
4169
+ auto resolvedSource = source.getSource (*this , type);
4170
+
4170
4171
// Add the conformance requirement, bailing out earlier if we've already
4171
4172
// seen it.
4172
4173
auto equivClass = type.getEquivalenceClass (*this );
4173
- if (!equivClass->recordConformanceConstraint (*this , type, proto, source))
4174
+ if (!equivClass->recordConformanceConstraint (*this , type, proto,
4175
+ resolvedSource))
4174
4176
return ConstraintResult::Resolved;
4175
4177
4176
- auto resolvedSource = source.getSource (*this , type);
4177
4178
return expandConformanceRequirement (type, proto, resolvedSource,
4178
4179
/* onlySameTypeRequirements=*/ false );
4179
4180
}
@@ -4325,7 +4326,7 @@ ConstraintResult GenericSignatureBuilder::addSuperclassRequirementDirect(
4325
4326
++NumSuperclassConstraints;
4326
4327
4327
4328
// Update the equivalence class with the constraint.
4328
- if (!updateSuperclass (type, superclass, source ))
4329
+ if (!updateSuperclass (type, superclass, resolvedSource ))
4329
4330
++NumSuperclassConstraintsExtra;
4330
4331
4331
4332
return ConstraintResult::Resolved;
0 commit comments