Skip to content

Commit f5212e7

Browse files
committed
AST: Better assertion output in Requirement::compare()
1 parent 967a8b4 commit f5212e7

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/AST/GenericSignature.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,12 @@ int Requirement::compare(const Requirement &other) const {
729729
return compareKind;
730730

731731
// We should only have multiple conformance requirements.
732-
assert(getKind() == RequirementKind::Conformance);
732+
if (getKind() != RequirementKind::Conformance) {
733+
llvm::errs() << "Unordered generic requirements\n";
734+
llvm::errs() << "LHS: "; dump(llvm::errs()); llvm::errs() << "\n";
735+
llvm::errs() << "RHS: "; other.dump(llvm::errs()); llvm::errs() << "\n";
736+
abort();
737+
}
733738

734739
int compareProtos =
735740
TypeDecl::compare(getProtocolDecl(), other.getProtocolDecl());

0 commit comments

Comments
 (0)