@@ -5512,32 +5512,6 @@ void Decl::printInherited(ASTPrinter &Printer, const PrintOptions &Opts) const {
5512
5512
printer.printInherited (this );
5513
5513
}
5514
5514
5515
- // / Determine whether this typealias is an inferred typealias "Failure" that
5516
- // / would conflict with another entity named failure in the same type.
5517
- static bool isConflictingFailureTypeWitness (
5518
- const TypeAliasDecl *typealias) {
5519
- if (!typealias->isImplicit ())
5520
- return false ;
5521
-
5522
- ASTContext &ctx = typealias->getASTContext ();
5523
- if (typealias->getName () != ctx.Id_Failure )
5524
- return false ;
5525
-
5526
- auto nominal = typealias->getDeclContext ()->getSelfNominalTypeDecl ();
5527
- if (!nominal)
5528
- return false ;
5529
-
5530
- // Look for another entity with the same name.
5531
- auto lookupResults = nominal->lookupDirect (
5532
- typealias->getName (), typealias->getLoc ());
5533
- for (auto found : lookupResults) {
5534
- if (found != typealias)
5535
- return true ;
5536
- }
5537
-
5538
- return false ;
5539
- }
5540
-
5541
5515
bool Decl::shouldPrintInContext (const PrintOptions &PO) const {
5542
5516
// Skip getters/setters. They are part of the variable or subscript.
5543
5517
if (isa<AccessorDecl>(this ))
@@ -5577,14 +5551,6 @@ bool Decl::shouldPrintInContext(const PrintOptions &PO) const {
5577
5551
return PO.PrintIfConfig ;
5578
5552
}
5579
5553
5580
- // Prior to Swift 6, we shouldn't print the inferred associated type
5581
- // witness for AsyncSequence.Failure. It is always determined from the
5582
- // AsyncIteratorProtocol witness.
5583
- if (auto typealias = dyn_cast<TypeAliasDecl>(this )) {
5584
- if (isConflictingFailureTypeWitness (typealias))
5585
- return false ;
5586
- }
5587
-
5588
5554
// Print everything else.
5589
5555
return true ;
5590
5556
}
0 commit comments