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) {
4285
4285
// Protocol extension initializers are modeled as convenience initializers,
4286
4286
// but they're not written that way in source. Check if we're actually
4287
4287
// 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, " " );
4297
4295
} else {
4298
4296
assert (decl->getDeclContext ()->getExtendedProtocolDecl () &&
4299
4297
" unexpected convenience initializer" );
Original file line number Diff line number Diff line change 12
12
// CHECK-LABEL: public actor TestActor {
13
13
@available ( SwiftStdlib 5 . 5 , * )
14
14
public 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)
17
16
public init ( convenience: Int ) {
18
17
self . init ( )
19
18
}
You can’t perform that action at this time.
0 commit comments