File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -2715,6 +2715,37 @@ class Verifier : public ASTWalker {
2715
2715
verifyCheckedBase (nominal);
2716
2716
}
2717
2717
2718
+ void verifyCheckedAlways (GenericTypeParamDecl *GTPD) {
2719
+ PrettyStackTraceDecl debugStack (" verifying GenericTypeParamDecl" , GTPD);
2720
+
2721
+ const DeclContext *DC = GTPD->getDeclContext ();
2722
+ if (!GTPD->getDeclContext ()->isInnermostContextGeneric ()) {
2723
+ Out << " DeclContext of GenericTypeParamDecl does not have "
2724
+ " generic params" ;
2725
+ abort ();
2726
+ }
2727
+
2728
+ GenericParamList *paramList =
2729
+ static_cast <const GenericContext *>(DC)->getGenericParams ();
2730
+ if (!paramList) {
2731
+ Out << " DeclContext of GenericTypeParamDecl does not have "
2732
+ " generic params" ;
2733
+ abort ();
2734
+ }
2735
+
2736
+ if (paramList->size () <= GTPD->getIndex () ||
2737
+ paramList->getParams ()[GTPD->getIndex ()] != GTPD) {
2738
+ Out << " GenericTypeParamDecl has incorrect index" ;
2739
+ abort ();
2740
+ }
2741
+ if (paramList->getDepth () != GTPD->getDepth ()) {
2742
+ Out << " GenericTypeParamDecl has incorrect depth" ;
2743
+ abort ();
2744
+ }
2745
+
2746
+ verifyCheckedBase (GTPD);
2747
+ }
2748
+
2718
2749
void verifyChecked (ExtensionDecl *ext) {
2719
2750
// Make sure that the protocol conformances are complete.
2720
2751
for (auto conformance : ext->getLocalConformances ()) {
You can’t perform that action at this time.
0 commit comments