@@ -379,8 +379,9 @@ static bool doesAccessorNeedDynamicAttribute(AccessorDecl *accessor) {
379379CtorInitializerKind
380380InitKindRequest::evaluate (Evaluator &evaluator, ConstructorDecl *decl) const {
381381 auto &diags = decl->getASTContext ().Diags ;
382+ auto dc = decl->getDeclContext ();
382383
383- if (auto nominal = decl-> getDeclContext () ->getSelfNominalTypeDecl ()) {
384+ if (auto nominal = dc ->getSelfNominalTypeDecl ()) {
384385
385386 // Convenience inits are only allowed on classes and in extensions thereof.
386387 if (auto convenAttr = decl->getAttrs ().getAttribute <ConvenienceAttr>()) {
@@ -390,6 +391,7 @@ InitKindRequest::evaluate(Evaluator &evaluator, ConstructorDecl *decl) const {
390391 diags.diagnose (decl->getLoc (),
391392 diag::no_convenience_keyword_init, " actors" )
392393 .fixItRemove (convenAttr->getLocation ())
394+ .warnInSwiftInterface (dc)
393395 .warnUntilSwiftVersion (6 );
394396
395397 } else { // not an actor
@@ -447,7 +449,7 @@ InitKindRequest::evaluate(Evaluator &evaluator, ConstructorDecl *decl) const {
447449 // (or the same file) to add vtable entries, we can re-evaluate this
448450 // restriction.
449451 if (!decl->isSynthesized () &&
450- isa<ExtensionDecl>(decl-> getDeclContext () ->getImplementedObjCContext ()) &&
452+ isa<ExtensionDecl>(dc ->getImplementedObjCContext ()) &&
451453 !(decl->getAttrs ().hasAttribute <DynamicReplacementAttr>())) {
452454
453455 if (classDcl->getForeignClassKind () == ClassDecl::ForeignKind::CFType) {
@@ -476,7 +478,7 @@ InitKindRequest::evaluate(Evaluator &evaluator, ConstructorDecl *decl) const {
476478 } // end of Nominal context
477479
478480 // initializers in protocol extensions must be convenience inits
479- if (decl-> getDeclContext () ->getExtendedProtocolDecl ()) {
481+ if (dc ->getExtendedProtocolDecl ()) {
480482 return CtorInitializerKind::Convenience;
481483 }
482484
0 commit comments