Skip to content

Commit c0c109d

Browse files
committed
RequirementMachine: Tighten verifyRewriteRules() further
We should never have a rule with a protocol symbol on the *right* hand side, like (T => U.[P]).
1 parent 4c7fc73 commit c0c109d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lib/AST/RequirementMachine/RewriteSystem.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -591,10 +591,7 @@ void RewriteSystem::verifyRewriteRules(ValidityPolicy policy) const {
591591
ASSERT_RULE(symbol.getKind() != Symbol::Kind::GenericParam);
592592
}
593593

594-
// Completion can produce rules like [P:T].[Q:R] => [P:T].[Q]
595-
// which are immediately simplified away.
596-
if (!rule.isRHSSimplified() &&
597-
index != 0) {
594+
if (index != 0) {
598595
ASSERT_RULE(symbol.getKind() != Symbol::Kind::Protocol);
599596
}
600597
}

0 commit comments

Comments
 (0)