[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:
Doug Gregor
2021-06-30 16:34:18 -07:00
parent f5dc1a1b48
commit e595b4f68a
7 changed files with 9 additions and 26 deletions

View File

@@ -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);