File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed
lib/AST/RequirementMachine Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -741,7 +741,8 @@ RewriteSystem::getRedundantRequirements() {
741
741
for (unsigned ruleID : indices (getRules ())) {
742
742
auto &rule = getRules ()[ruleID];
743
743
744
- if (!rule.isExplicit () && !rule.isPermanent () && !rule.isRedundant ())
744
+ if (!rule.isExplicit () && !rule.isPermanent () && !rule.isRedundant () &&
745
+ isInMinimizationDomain (rule.getLHS ().getRootProtocol ()))
745
746
impliedRequirements.insert (ruleID);
746
747
747
748
if (!rule.isExplicit ())
Original file line number Diff line number Diff line change @@ -40,13 +40,13 @@ protocol G1 {
40
40
// CHECK: rdar83308672.(file).G2@
41
41
// CHECK-NEXT: Requirement signature: <Self where Self.[G2]T : A, Self.[G2]T.[A]X == Self.[G2]T.[A]Y>
42
42
protocol G2 {
43
- associatedtype T : A where T : B , T. X == T . Y
43
+ associatedtype T : A where T : B , T. X == T . Y // expected-warning {{redundant conformance constraint 'Self.T' : 'B'}}
44
44
}
45
45
46
46
// CHECK: rdar83308672.(file).G3@
47
47
// CHECK-NEXT: Requirement signature: <Self where Self.[G3]T : A, Self.[G3]T.[A]X == Self.[G3]T.[A]Y>
48
48
protocol G3 {
49
- associatedtype T : A where T. X == T . Y , T : B
49
+ associatedtype T : A where T. X == T . Y , T : B // expected-warning {{redundant conformance constraint 'Self.T' : 'B'}}
50
50
}
51
51
52
52
// CHECK: rdar83308672.(file).G4@
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ protocol P7 : P6 {
152
152
associatedtype AssocP7 : P6
153
153
}
154
154
155
- // FIXME: diagnose redundant requirement ' AssocP6.Element : P6'
155
+ // expected-warning@+1{{ redundant conformance constraint 'Self. AssocP6.Element' : ' P6'}}
156
156
extension P7 where AssocP6. Element : P6 ,
157
157
AssocP7. AssocP6. Element : P6 ,
158
158
AssocP6. Element == AssocP7 . AssocP6 . Element {
You can’t perform that action at this time.
0 commit comments