@@ -378,8 +378,9 @@ static bool doesAccessorNeedDynamicAttribute(AccessorDecl *accessor) {
378378CtorInitializerKind
379379InitKindRequest::evaluate (Evaluator &evaluator, ConstructorDecl *decl) const {
380380 auto &diags = decl->getASTContext ().Diags ;
381+ auto dc = decl->getDeclContext ();
381382
382- if (auto nominal = decl-> getDeclContext () ->getSelfNominalTypeDecl ()) {
383+ if (auto nominal = dc ->getSelfNominalTypeDecl ()) {
383384
384385 // Convenience inits are only allowed on classes and in extensions thereof.
385386 if (auto convenAttr = decl->getAttrs ().getAttribute <ConvenienceAttr>()) {
@@ -389,6 +390,7 @@ InitKindRequest::evaluate(Evaluator &evaluator, ConstructorDecl *decl) const {
389390 diags.diagnose (decl->getLoc (),
390391 diag::no_convenience_keyword_init, " actors" )
391392 .fixItRemove (convenAttr->getLocation ())
393+ .warnInSwiftInterface (dc)
392394 .warnUntilSwiftVersion (6 );
393395
394396 } else { // not an actor
@@ -446,7 +448,7 @@ InitKindRequest::evaluate(Evaluator &evaluator, ConstructorDecl *decl) const {
446448 // (or the same file) to add vtable entries, we can re-evaluate this
447449 // restriction.
448450 if (!decl->isSynthesized () &&
449- isa<ExtensionDecl>(decl-> getDeclContext () ->getImplementedObjCContext ()) &&
451+ isa<ExtensionDecl>(dc ->getImplementedObjCContext ()) &&
450452 !(decl->getAttrs ().hasAttribute <DynamicReplacementAttr>())) {
451453
452454 if (classDcl->getForeignClassKind () == ClassDecl::ForeignKind::CFType) {
@@ -475,7 +477,7 @@ InitKindRequest::evaluate(Evaluator &evaluator, ConstructorDecl *decl) const {
475477 } // end of Nominal context
476478
477479 // initializers in protocol extensions must be convenience inits
478- if (decl-> getDeclContext () ->getExtendedProtocolDecl ()) {
480+ if (dc ->getExtendedProtocolDecl ()) {
479481 return CtorInitializerKind::Convenience;
480482 }
481483
0 commit comments