We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bf7f36 commit 2e0a8a3Copy full SHA for 2e0a8a3
lib/AST/ASTVerifier.cpp
@@ -2807,6 +2807,19 @@ class Verifier : public ASTWalker {
2807
2808
unsigned currentDepth = DC->getGenericContextDepth();
2809
if (currentDepth < GTPD->getDepth()) {
2810
+ // If this is actually an opaque type's generic parameter, we're okay.
2811
+ if (auto value = dyn_cast_or_null<ValueDecl>(DC->getAsDecl())) {
2812
+ auto opaqueDecl = dyn_cast<OpaqueTypeDecl>(value);
2813
+ if (!opaqueDecl)
2814
+ opaqueDecl = value->getOpaqueResultTypeDecl();
2815
+ if (opaqueDecl) {
2816
+ if (GTPD->getDepth() ==
2817
+ opaqueDecl->getOpaqueGenericParams().front()->getDepth()) {
2818
+ return;
2819
+ }
2820
2821
2822
+
2823
Out << "GenericTypeParamDecl has incorrect depth\n";
2824
abort();
2825
}
0 commit comments