mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SE-0306] Ban "open" and "required" on actors.
Because actors don't have inheritance, ban "open" and "required", which don't make sense. We will permit "final" which, although it doesn't have any semantic impact, is still used to determine whether the ABI of the actor itself might permit subclassing in the future. This leaves the door slightly ajar for actor inheritance should we need to revisit that decision. Fixes SR-14785 / rdar://79401150.
This commit is contained in:
@@ -223,10 +223,6 @@ createDistributedActor_init_local(ClassDecl *classDecl,
|
||||
initDecl->setSynthesized();
|
||||
initDecl->setBodySynthesizer(&createBody_DistributedActor_init_transport);
|
||||
|
||||
// This constructor is 'required', all distributed actors MUST invoke it.
|
||||
auto *reqAttr = new (C) RequiredAttr(/*IsImplicit*/true);
|
||||
initDecl->getAttrs().add(reqAttr);
|
||||
|
||||
auto *nonIsoAttr = new (C) NonisolatedAttr(/*IsImplicit*/true);
|
||||
initDecl->getAttrs().add(nonIsoAttr);
|
||||
|
||||
@@ -350,9 +346,6 @@ createDistributedActor_init_resolve(ClassDecl *classDecl,
|
||||
initDecl->setSynthesized();
|
||||
initDecl->setBodySynthesizer(&createDistributedActor_init_resolve_body);
|
||||
|
||||
// This constructor is 'required', all distributed actors MUST have it.
|
||||
initDecl->getAttrs().add(new (C) RequiredAttr(/*IsImplicit*/true));
|
||||
|
||||
auto *nonIsoAttr = new (C) NonisolatedAttr(/*IsImplicit*/true);
|
||||
initDecl->getAttrs().add(nonIsoAttr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user