File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -4285,15 +4285,13 @@ void PrintAST::visitConstructorDecl(ConstructorDecl *decl) {
42854285 // Protocol extension initializers are modeled as convenience initializers,
42864286 // but they're not written that way in source. Check if we're actually
42874287 // printing onto a class.
4288- bool isClassContext;
4289- if (CurrentType) {
4290- isClassContext = CurrentType->getClassOrBoundGenericClass () != nullptr ;
4291- } else {
4292- const DeclContext *dc = decl->getDeclContext ();
4293- isClassContext = dc->getSelfClassDecl () != nullptr ;
4294- }
4295- if (isClassContext) {
4296- Printer.printKeyword (" convenience" , Options, " " );
4288+ ClassDecl *classDecl = CurrentType
4289+ ? CurrentType->getClassOrBoundGenericClass ()
4290+ : decl->getDeclContext ()->getSelfClassDecl ();
4291+ if (classDecl) {
4292+ // Convenience intializers are also unmarked on actors.
4293+ if (!classDecl->isActor ())
4294+ Printer.printKeyword (" convenience" , Options, " " );
42974295 } else {
42984296 assert (decl->getDeclContext ()->getExtendedProtocolDecl () &&
42994297 " unexpected convenience initializer" );
Original file line number Diff line number Diff line change 1212// CHECK-LABEL: public actor TestActor {
1313@available ( SwiftStdlib 5 . 5 , * )
1414public actor TestActor {
15- // FIXME: The convenience keyword should be omitted (rdar://130926278)
16- // CHECK: public convenience init(convenience: Swift.Int)
15+ // CHECK: public init(convenience: Swift.Int)
1716 public init ( convenience: Int ) {
1817 self . init ( )
1918 }
You can’t perform that action at this time.
0 commit comments