@@ -93,95 +93,6 @@ static void addFactoryResolveFunction(ClassDecl *decl) {
9393 decl->addMember (factoryDecl);
9494}
9595
96- /* *****************************************************************************/
97- /* ******************************* PROPERTIES **********************************/
98- /* *****************************************************************************/
99-
100- // TODO: deduplicate with 'declareDerivedProperty' from DerivedConformance...
101- std::pair<VarDecl *, PatternBindingDecl *>
102- createStoredProperty (ClassDecl *classDecl, ASTContext &ctx,
103- VarDecl::Introducer introducer, Identifier name,
104- Type propertyInterfaceType, Type propertyContextType,
105- bool isStatic, bool isFinal) {
106- auto parentDC = classDecl;
107-
108- VarDecl *propDecl = new (ctx)
109- VarDecl (/* IsStatic*/ isStatic, introducer,
110- SourceLoc (), name, parentDC);
111- propDecl->setImplicit ();
112- propDecl->setSynthesized ();
113- propDecl->copyFormalAccessFrom (classDecl, /* sourceIsParentContext*/ true );
114- propDecl->setInterfaceType (propertyInterfaceType);
115-
116- Pattern *propPat = NamedPattern::createImplicit (ctx, propDecl);
117- propPat->setType (propertyContextType);
118-
119- propPat = TypedPattern::createImplicit (ctx, propPat, propertyContextType);
120- propPat->setType (propertyContextType);
121-
122- auto *pbDecl = PatternBindingDecl::createImplicit (
123- ctx, StaticSpellingKind::None, propPat, /* InitExpr*/ nullptr ,
124- parentDC);
125- return {propDecl, pbDecl};
126- }
127-
128- // / Adds the following, fairly special, properties to each distributed actor:
129- // / - actorTransport
130- // / - id
131- // TODO(distributed): move this synthesis to DerivedConformance style
132- static void addImplicitDistributedActorStoredProperties (ClassDecl *decl) {
133- assert (decl->isDistributedActor ());
134-
135- auto &C = decl->getASTContext ();
136-
137- // ```
138- // @_distributedActorIndependent
139- // let id: AnyActorIdentity
140- // ```
141- {
142- auto propertyType = C.getAnyActorIdentityDecl ()->getDeclaredInterfaceType ();
143-
144- VarDecl *propDecl;
145- PatternBindingDecl *pbDecl;
146- std::tie (propDecl, pbDecl) = createStoredProperty (
147- decl, C,
148- VarDecl::Introducer::Let, C.Id_id ,
149- propertyType, propertyType,
150- /* isStatic=*/ false , /* isFinal=*/ true );
151-
152- // mark as @_distributedActorIndependent, allowing access to it from everywhere
153- propDecl->getAttrs ().add (
154- new (C) DistributedActorIndependentAttr (/* IsImplicit=*/ true ));
155-
156- decl->addMember (propDecl);
157- decl->addMember (pbDecl);
158- }
159-
160- // ```
161- // @_distributedActorIndependent
162- // let actorTransport: ActorTransport
163- // ```
164- // (no need for @actorIndependent because it is an immutable let)
165- {
166- auto propertyType = C.getActorTransportDecl ()->getDeclaredInterfaceType ();
167-
168- VarDecl *propDecl;
169- PatternBindingDecl *pbDecl;
170- std::tie (propDecl, pbDecl) = createStoredProperty (
171- decl, C,
172- VarDecl::Introducer::Let, C.Id_actorTransport ,
173- propertyType, propertyType,
174- /* isStatic=*/ false , /* isFinal=*/ true );
175-
176- // mark as @_distributedActorIndependent, allowing access to it from everywhere
177- propDecl->getAttrs ().add (
178- new (C) DistributedActorIndependentAttr (/* IsImplicit=*/ true ));
179-
180- decl->addMember (propDecl);
181- decl->addMember (pbDecl);
182- }
183- }
184-
18596/* *****************************************************************************/
18697/* ************************** _REMOTE_ FUNCTIONS *******************************/
18798/* *****************************************************************************/
@@ -355,6 +266,6 @@ void swift::addImplicitDistributedActorMembersToClass(ClassDecl *decl) {
355266 return ;
356267
357268 addFactoryResolveFunction (decl);
358- addImplicitDistributedActorStoredProperties (decl);
269+ // addImplicitDistributedActorStoredProperties(decl);
359270 addImplicitRemoteActorFunctions (decl);
360271}
0 commit comments