@@ -5512,32 +5512,6 @@ void Decl::printInherited(ASTPrinter &Printer, const PrintOptions &Opts) const {
55125512 printer.printInherited (this );
55135513}
55145514
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-
55415515bool Decl::shouldPrintInContext (const PrintOptions &PO) const {
55425516 // Skip getters/setters. They are part of the variable or subscript.
55435517 if (isa<AccessorDecl>(this ))
@@ -5577,14 +5551,6 @@ bool Decl::shouldPrintInContext(const PrintOptions &PO) const {
55775551 return PO.PrintIfConfig ;
55785552 }
55795553
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-
55885554 // Print everything else.
55895555 return true ;
55905556}
0 commit comments