Skip to content

Commit 0c0a963

Browse files
committed
SIL: Print ErrorTypes with @error_type prefix to avoid confusion
In diagnostics, we print wrapped ErrorTypes as their original type. This is confusing when debugging SIL issues though, where we don't expect to see ErrorTypes. Print them as '@error_type <origtype>' instead.
1 parent 61104cf commit 0c0a963

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3780,8 +3780,11 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
37803780
}
37813781

37823782
void visitErrorType(ErrorType *T) {
3783-
if (auto originalType = T->getOriginalType())
3783+
if (auto originalType = T->getOriginalType()) {
3784+
if (Options.PrintInSILBody)
3785+
Printer << "@error_type ";
37843786
visit(originalType);
3787+
}
37853788
else
37863789
Printer << "<<error type>>";
37873790
}

0 commit comments

Comments
 (0)