File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
lib/AST/RequirementMachine Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -551,6 +551,12 @@ void RewriteSystem::verifyRewriteRules(ValidityPolicy policy) const {
551
551
ASSERT_RULE (symbol.getKind () != Symbol::Kind::Layout);
552
552
ASSERT_RULE (symbol.getKind () != Symbol::Kind::Superclass);
553
553
ASSERT_RULE (symbol.getKind () != Symbol::Kind::ConcreteType);
554
+ ASSERT_RULE (symbol.getKind () != Symbol::Kind::Shape);
555
+ }
556
+
557
+ // A shape symbol must follow a generic param symbol
558
+ if (symbol.getKind () == Symbol::Kind::Shape) {
559
+ ASSERT_RULE (index > 0 && lhs[index - 1 ].getKind () == Symbol::Kind::GenericParam);
554
560
}
555
561
556
562
if (!rule.isLHSSimplified () &&
@@ -595,6 +601,15 @@ void RewriteSystem::verifyRewriteRules(ValidityPolicy policy) const {
595
601
ASSERT_RULE (symbol.getKind () != Symbol::Kind::Superclass);
596
602
ASSERT_RULE (symbol.getKind () != Symbol::Kind::ConcreteType);
597
603
604
+ if (index != lhs.size () - 1 ) {
605
+ ASSERT_RULE (symbol.getKind () != Symbol::Kind::Shape);
606
+ }
607
+
608
+ // A shape symbol must follow a generic param symbol
609
+ if (symbol.getKind () == Symbol::Kind::Shape) {
610
+ ASSERT_RULE (index > 0 && rhs[index - 1 ].getKind () == Symbol::Kind::GenericParam);
611
+ }
612
+
598
613
// Completion can introduce a rule of the form
599
614
//
600
615
// (T.[P] => T.[concrete: C : P])
You can’t perform that action at this time.
0 commit comments