Skip to content

Commit b603551

Browse files
committed
Print Variadic Sequence Types with Array Slice Sugar in SIL Mode
The SIL parser cannot handle 'T...'. Use '[T]' instead.
1 parent 704c7e1 commit b603551

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6196,8 +6196,14 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
61966196
}
61976197

61986198
void visitVariadicSequenceType(VariadicSequenceType *T) {
6199-
visit(T->getBaseType());
6200-
Printer << "...";
6199+
if (Options.PrintForSIL) {
6200+
Printer << "[";
6201+
visit(T->getBaseType());
6202+
Printer << "]";
6203+
} else {
6204+
visit(T->getBaseType());
6205+
Printer << "...";
6206+
}
62016207
}
62026208

62036209
void visitProtocolType(ProtocolType *T) {

0 commit comments

Comments
 (0)