@@ -526,6 +526,7 @@ verificationError(ASTContext &ctx, llvm::StringRef msg,
526
526
auto context = std::get<1 >(pair);
527
527
llvm::errs () << label << " :\n " ;
528
528
context->print (llvm::errs (), ctx.SourceMgr );
529
+ llvm::errs () << " \n " ;
529
530
}
530
531
abort ();
531
532
}
@@ -570,18 +571,20 @@ void TypeRefinementContext::verify(const TypeRefinementContext *parent,
570
571
if (!SrcRange.isValid ())
571
572
verificationError (ctx, " invalid source range" , {{" node" , this }});
572
573
574
+ // Child nodes must be contained by their parents in all dimensions (source
575
+ // range, introduction version, etc).
573
576
if (getReason () != Reason::Root) {
574
577
auto parentRange = parent->SrcRange ;
575
578
if (parentRange.isValid () &&
576
579
!(srcMgr.isAtOrBefore (parentRange.Start , SrcRange.Start ) &&
577
580
srcMgr.isAtOrBefore (SrcRange.End , parentRange.End )))
578
581
verificationError (ctx, " child source range not contained" ,
579
- {{" child" , this }, {" parent" , this }});
582
+ {{" child" , this }, {" parent" , parent }});
580
583
}
581
584
582
585
if (!AvailabilityInfo.isContainedIn (parent->AvailabilityInfo ))
583
586
verificationError (ctx, " child availability range not contained" ,
584
- {{" child" , this }, {" parent" , this }});
587
+ {{" child" , this }, {" parent" , parent }});
585
588
}
586
589
587
590
void TypeRefinementContext::verify (ASTContext &ctx) {
0 commit comments