@@ -1096,12 +1096,14 @@ const RequirementSource *RequirementSource::getMinimalConformanceSource(
1096
1096
ArchetypeResolutionKind::WellFormed);
1097
1097
assert (parentEquivClass && " Not a well-formed type?" );
1098
1098
1099
- if (parentEquivClass->concreteType )
1100
- derivedViaConcrete = true ;
1101
- else if (parentEquivClass->superclass &&
1102
- builder.lookupConformance (parentEquivClass->superclass ,
1103
- source->getProtocolDecl ()))
1104
- derivedViaConcrete = true ;
1099
+ if (requirementSignatureSelfProto) {
1100
+ if (parentEquivClass->concreteType )
1101
+ derivedViaConcrete = true ;
1102
+ else if (parentEquivClass->superclass &&
1103
+ builder.lookupConformance (parentEquivClass->superclass ,
1104
+ source->getProtocolDecl ()))
1105
+ derivedViaConcrete = true ;
1106
+ }
1105
1107
1106
1108
// The parent potential archetype must conform to the protocol in which
1107
1109
// this requirement resides. Add this constraint.
@@ -7200,6 +7202,9 @@ void GenericSignatureBuilder::diagnoseRedundantRequirements() const {
7200
7202
7201
7203
for (auto otherReq : found->second ) {
7202
7204
auto *otherSource = otherReq.getSource ();
7205
+ if (otherSource->isInferredRequirement ())
7206
+ continue ;
7207
+
7203
7208
auto otherLoc = otherSource->getLoc ();
7204
7209
if (otherLoc.isInvalid ())
7205
7210
continue ;
@@ -7237,6 +7242,9 @@ void GenericSignatureBuilder::diagnoseRedundantRequirements() const {
7237
7242
7238
7243
for (auto otherReq : found->second ) {
7239
7244
auto *otherSource = otherReq.getSource ();
7245
+ if (otherSource->isInferredRequirement ())
7246
+ continue ;
7247
+
7240
7248
auto otherLoc = otherSource->getLoc ();
7241
7249
if (otherLoc.isInvalid ())
7242
7250
continue ;
@@ -7276,6 +7284,9 @@ void GenericSignatureBuilder::diagnoseRedundantRequirements() const {
7276
7284
7277
7285
for (auto otherReq : found->second ) {
7278
7286
auto *otherSource = otherReq.getSource ();
7287
+ if (otherSource->isInferredRequirement ())
7288
+ continue ;
7289
+
7279
7290
auto otherLoc = otherSource->getLoc ();
7280
7291
if (otherLoc.isInvalid ())
7281
7292
continue ;
0 commit comments