mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
RequirementMachine: Relax assertion in verifyRewriteSystem()
We can end up with a rule that has a protocol symbol on the right hand side:
X.Y.Z => X.W.[P]
This will occur if X.W.[P] was obtained by simplifying a term X.W.U.V via
a rule (U.V => [P]), and before completion discovers a rule
(X.W.[P] => X.W).
Fixes rdar://problem/94854326, rdar://problem/94980084.
This commit is contained in:
@@ -591,7 +591,7 @@ void RewriteSystem::verifyRewriteRules(ValidityPolicy policy) const {
|
||||
ASSERT_RULE(symbol.getKind() != Symbol::Kind::GenericParam);
|
||||
}
|
||||
|
||||
if (index != 0) {
|
||||
if (index != 0 && !rule.isRHSSimplified()) {
|
||||
ASSERT_RULE(symbol.getKind() != Symbol::Kind::Protocol);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user