Explorer: improve type checking trace output (#3039)

Updates the trace output for type checking to be more consistent like
the rest of trace output.
This PR also includes few changes in the lit tests related to trace
output.

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
Prabhat SachdevaandRichard Smith authored and GitHub committed 2023-08-08 17:58:12 +00:00
1 parent 6d3a4b84cb
commit a359da37c4
10 files changed
+638 -259

No files matched your search

+6 -5
View File
@@ -415,10 +415,11 @@ auto ImplScope::TryResolveInterfaceHere(
// TODO: Add indentation when printing the parents.
void ImplScope::Print(llvm::raw_ostream& out) const {
out << "impl declarations: ";
llvm::ListSeparator sep;
llvm::ListSeparator sep(",\n ");
out << " + "
<< "[";
for (const ImplFact& impl : impl_facts_) {
out << sep << *(impl.type) << " as " << *(impl.interface);
out << sep << "`" << *(impl.type) << "` as `" << *(impl.interface) << "`";
if (impl.sort_key) {
out << " " << *impl.sort_key;
}
@@ -427,10 +428,10 @@ void ImplScope::Print(llvm::raw_ostream& out) const {
out << sep;
llvm::ListSeparator equal(" == ");
for (Nonnull<const Value*> value : eq->values) {
out << equal << *value;
out << equal << "`" << *value << "`";
}
}
out << "\n";
out << "]\n";
if (parent_scope_) {
out << **parent_scope_;
}