@@ -2066,23 +2066,24 @@ static void checkProtocolRefinementRequirements(ProtocolDecl *proto) {
2066
2066
2067
2067
static void dumpGenericSignature (ASTContext &ctx, GenericContext *GC) {
2068
2068
if (ctx.TypeCheckerOpts .DebugGenericSignatures ) {
2069
- llvm::errs () << " \n " ;
2070
- if (auto *VD = dyn_cast_or_null<ValueDecl>(GC->getAsDecl ())) {
2071
- VD->dumpRef (llvm::errs ());
2069
+ if (auto sig = GC->getGenericSignature ()) {
2070
+ llvm::errs () << " \n " ;
2071
+ if (auto *VD = dyn_cast_or_null<ValueDecl>(GC->getAsDecl ())) {
2072
+ VD->dumpRef (llvm::errs ());
2073
+ llvm::errs () << " \n " ;
2074
+ } else {
2075
+ GC->printContext (llvm::errs ());
2076
+ }
2077
+ llvm::errs () << " Generic signature: " ;
2078
+ PrintOptions Opts;
2079
+ Opts.ProtocolQualifiedDependentMemberTypes = true ;
2080
+ Opts.PrintInverseRequirements = true ;
2081
+ sig->print (llvm::errs (), Opts);
2082
+ llvm::errs () << " \n " ;
2083
+ llvm::errs () << " Canonical generic signature: " ;
2084
+ sig.getCanonicalSignature ()->print (llvm::errs (), Opts);
2072
2085
llvm::errs () << " \n " ;
2073
- } else {
2074
- GC->printContext (llvm::errs ());
2075
2086
}
2076
- auto sig = GC->getGenericSignature ();
2077
- llvm::errs () << " Generic signature: " ;
2078
- PrintOptions Opts;
2079
- Opts.ProtocolQualifiedDependentMemberTypes = true ;
2080
- Opts.PrintInverseRequirements = true ;
2081
- sig->print (llvm::errs (), Opts);
2082
- llvm::errs () << " \n " ;
2083
- llvm::errs () << " Canonical generic signature: " ;
2084
- sig.getCanonicalSignature ()->print (llvm::errs (), Opts);
2085
- llvm::errs () << " \n " ;
2086
2087
}
2087
2088
}
2088
2089
0 commit comments