File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -6559,16 +6559,13 @@ class TypePrinter : public TypeVisitor<TypePrinter> {
65596559
65606560 // Print based on the type.
65616561 Printer << " some " ;
6562- if (!decl->getConformingProtocols ().empty ()) {
6563- llvm::interleave (decl->getConformingProtocols (), Printer, [&](ProtocolDecl *proto){
6564- if (auto printType = proto->getDeclaredType ())
6565- printType->print (Printer, Options);
6566- else
6567- Printer << proto->getNameStr ();
6568- }, " & " );
6569- } else {
6570- Printer << " Any" ;
6571- }
6562+ auto archetypeType = decl->getDeclContext ()->mapTypeIntoContext (
6563+ decl->getDeclaredInterfaceType ())->castTo <ArchetypeType>();
6564+ auto constraintType = archetypeType->getExistentialType ();
6565+ if (auto *existentialType = constraintType->getAs <ExistentialType>())
6566+ constraintType = existentialType->getConstraintType ();
6567+
6568+ constraintType->print (Printer, Options);
65726569 return ;
65736570 }
65746571
You can’t perform that action at this time.
0 commit comments