@@ -603,23 +603,6 @@ static ArrayRef<EnumDecl *> getInheritedForCycleCheck(TypeChecker &tc,
603
603
return { };
604
604
}
605
605
606
- // Break the inheritance cycle for a protocol by removing all inherited
607
- // protocols.
608
- //
609
- // FIXME: Just remove the problematic inheritance?
610
- static void breakInheritanceCycle (ProtocolDecl *proto) {
611
- }
612
-
613
- // / Break the inheritance cycle for a class by removing its superclass.
614
- static void breakInheritanceCycle (ClassDecl *classDecl) {
615
- classDecl->setSuperclass (Type ());
616
- }
617
-
618
- // / Break the inheritance cycle for an enum by removing its raw type.
619
- static void breakInheritanceCycle (EnumDecl *enumDecl) {
620
- enumDecl->setRawType (Type ());
621
- }
622
-
623
606
// / Check for circular inheritance.
624
607
template <typename T>
625
608
static void checkCircularity (TypeChecker &tc, T *decl,
@@ -649,9 +632,6 @@ static void checkCircularity(TypeChecker &tc, T *decl,
649
632
circularDiag,
650
633
path.back ()->getName ());
651
634
652
- decl->setInvalid ();
653
- decl->setInterfaceType (ErrorType::get (tc.Context ));
654
- breakInheritanceCycle (decl);
655
635
break ;
656
636
}
657
637
@@ -663,10 +643,6 @@ static void checkCircularity(TypeChecker &tc, T *decl,
663
643
declKind, (*i)->getName ());
664
644
}
665
645
666
- // Set this declaration as invalid, then break the cycle somehow.
667
- decl->setInvalid ();
668
- decl->setInterfaceType (ErrorType::get (tc.Context ));
669
- breakInheritanceCycle (decl);
670
646
break ;
671
647
}
672
648
0 commit comments