@@ -452,6 +452,9 @@ class InheritedProtocolCollector {
452
452
inherited->isSpecificProtocol (KnownProtocolKind::Actor))
453
453
return TypeWalker::Action::Continue;
454
454
455
+ if (inherited->isSPI () && !printOptions.PrintSPIs )
456
+ return TypeWalker::Action::Continue;
457
+
455
458
if (isPublicOrUsableFromInline (inherited) &&
456
459
conformanceDeclaredInModule (M, nominal, inherited)) {
457
460
protocolsToPrint.push_back ({inherited, protoAndAvailability.second });
@@ -466,17 +469,20 @@ class InheritedProtocolCollector {
466
469
467
470
for (const auto &protoAndAvailability : protocolsToPrint) {
468
471
StreamPrinter printer (out);
472
+ ProtocolDecl *proto = protoAndAvailability.first ;
473
+
469
474
// FIXME: Shouldn't this be an implicit conversion?
470
475
TinyPtrVector<const DeclAttribute *> attrs;
471
476
attrs.insert (attrs.end (), protoAndAvailability.second .begin (),
472
477
protoAndAvailability.second .end ());
478
+ auto spiAttributes = proto->getAttrs ().getAttributes <SPIAccessControlAttr>();
479
+ attrs.insert (attrs.end (), spiAttributes.begin (), spiAttributes.end ());
473
480
DeclAttributes::print (printer, printOptions, attrs);
474
481
475
482
printer << " extension " ;
476
483
nominal->getDeclaredType ().print (printer, printOptions);
477
484
printer << " : " ;
478
485
479
- ProtocolDecl *proto = protoAndAvailability.first ;
480
486
proto->getDeclaredInterfaceType ()->print (printer, printOptions);
481
487
482
488
printer << " {}\n " ;
0 commit comments