Skip to content

Commit 4169f93

Browse files
committed
[AST] Fail an assertion when printing a TypeVariableType with an unknown originator
1 parent 124b098 commit 4169f93

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/AST/ASTDumper.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3766,8 +3766,10 @@ namespace {
37663766
printFlag("error_expr");
37673767
} else if (auto *DMT = originator.dyn_cast<DependentMemberType *>()) {
37683768
printRec("dependent_member_type", DMT);
3769-
} else {
3769+
} else if (originator.is<PlaceholderTypeRepr *>()) {
37703770
printFlag("placeholder_type_repr");
3771+
} else {
3772+
assert(false && "unknown originator");
37713773
}
37723774
PrintWithColorRAII(OS, ParenthesisColor) << ')';
37733775
}

lib/AST/ASTPrinter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5701,8 +5701,10 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
57015701
Printer << "error_expr";
57025702
} else if (auto *DMT = originator.dyn_cast<DependentMemberType *>()) {
57035703
visit(DMT);
5704-
} else {
5704+
} else if (originator.is<PlaceholderTypeRepr *>()) {
57055705
Printer << "placeholder_type_repr";
5706+
} else {
5707+
assert(false && "unknown originator");
57065708
}
57075709
Printer << ">>";
57085710
} else {

0 commit comments

Comments
 (0)