Skip to content

Commit 62e0680

Browse files
committed
simplify PrintAST::printTypedPattern by removing the now-always-false 'StripOuterSliceType' parameter.
1 parent 4da65bb commit 62e0680

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

lib/AST/ASTPrinter.cpp

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,7 @@ class PrintAST : public ASTVisitor<PrintAST> {
437437
}
438438

439439
void printAttributes(const Decl *D);
440-
void printTypedPattern(const TypedPattern *TP,
441-
bool StripOuterSliceType = false);
440+
void printTypedPattern(const TypedPattern *TP);
442441

443442
public:
444443
void printPattern(const Pattern *pattern);
@@ -514,8 +513,7 @@ void PrintAST::printAttributes(const Decl *D) {
514513
D->getAttrs().print(Printer, Options);
515514
}
516515

517-
void PrintAST::printTypedPattern(const TypedPattern *TP,
518-
bool StripOuterSliceType) {
516+
void PrintAST::printTypedPattern(const TypedPattern *TP) {
519517
auto TheTypeLoc = TP->getTypeLoc();
520518
if (TheTypeLoc.hasLocation()) {
521519
// If the outer typeloc is an InOutTypeRepr, print the inout before the
@@ -535,13 +533,6 @@ void PrintAST::printTypedPattern(const TypedPattern *TP,
535533

536534
printPattern(TP->getSubPattern());
537535
Printer << ": ";
538-
if (StripOuterSliceType) {
539-
Type T = TP->getType();
540-
if (auto *BGT = T->getAs<BoundGenericType>()) {
541-
BGT->getGenericArgs()[0].print(Printer, Options);
542-
return;
543-
}
544-
}
545536
printTypeLoc(TheTypeLoc);
546537
return;
547538
}
@@ -554,12 +545,6 @@ void PrintAST::printTypedPattern(const TypedPattern *TP,
554545

555546
printPattern(TP->getSubPattern());
556547
Printer << ": ";
557-
if (StripOuterSliceType) {
558-
if (auto *BGT = T->getAs<BoundGenericType>()) {
559-
BGT->getGenericArgs()[0].print(Printer, Options);
560-
return;
561-
}
562-
}
563548
T.print(Printer, Options);
564549
}
565550

0 commit comments

Comments
 (0)