@@ -437,8 +437,7 @@ class PrintAST : public ASTVisitor<PrintAST> {
437
437
}
438
438
439
439
void printAttributes (const Decl *D);
440
- void printTypedPattern (const TypedPattern *TP,
441
- bool StripOuterSliceType = false );
440
+ void printTypedPattern (const TypedPattern *TP);
442
441
443
442
public:
444
443
void printPattern (const Pattern *pattern);
@@ -514,8 +513,7 @@ void PrintAST::printAttributes(const Decl *D) {
514
513
D->getAttrs ().print (Printer, Options);
515
514
}
516
515
517
- void PrintAST::printTypedPattern (const TypedPattern *TP,
518
- bool StripOuterSliceType) {
516
+ void PrintAST::printTypedPattern (const TypedPattern *TP) {
519
517
auto TheTypeLoc = TP->getTypeLoc ();
520
518
if (TheTypeLoc.hasLocation ()) {
521
519
// If the outer typeloc is an InOutTypeRepr, print the inout before the
@@ -535,13 +533,6 @@ void PrintAST::printTypedPattern(const TypedPattern *TP,
535
533
536
534
printPattern (TP->getSubPattern ());
537
535
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
- }
545
536
printTypeLoc (TheTypeLoc);
546
537
return ;
547
538
}
@@ -554,12 +545,6 @@ void PrintAST::printTypedPattern(const TypedPattern *TP,
554
545
555
546
printPattern (TP->getSubPattern ());
556
547
Printer << " : " ;
557
- if (StripOuterSliceType) {
558
- if (auto *BGT = T->getAs <BoundGenericType>()) {
559
- BGT->getGenericArgs ()[0 ].print (Printer, Options);
560
- return ;
561
- }
562
- }
563
548
T.print (Printer, Options);
564
549
}
565
550
0 commit comments