@@ -426,7 +426,6 @@ static FuncDecl *deriveDistributedActorSystem_invokeHandlerOnReturn(
426
426
/* ****************************** PROPERTIES ***********************************/
427
427
/* *****************************************************************************/
428
428
429
- // TODO(distributed): make use of this after all, but FORCE it?
430
429
static ValueDecl *deriveDistributedActor_id (DerivedConformance &derived) {
431
430
assert (derived.Nominal ->isDistributedActor ());
432
431
auto &C = derived.Context ;
@@ -480,17 +479,12 @@ static ValueDecl *deriveDistributedActor_actorSystem(
480
479
// `actorSystem` MUST be the second field, because for a remote instance
481
480
// we don't allocate memory after those two fields, so their order is very
482
481
// important. The `hint` below makes sure the system is inserted right after.
483
- if (auto id = derived.Nominal ->getDistributedActorIDProperty ()) {
484
- derived.addMemberToConformanceContext (pbDecl, /* hint=*/ id);
485
- derived.addMemberToConformanceContext (propDecl, /* hint=*/ id);
486
- } else {
487
- // `id` will be synthesized next, and will insert at head,
488
- // so in order for system to be SECOND (as it must be),
489
- // we'll insert at head right now and as id gets synthesized we'll get
490
- // the correct order: id, actorSystem.
491
- derived.addMemberToConformanceContext (pbDecl, /* insertAtHead==*/ true );
492
- derived.addMemberToConformanceContext (propDecl, /* insertAtHead=*/ true );
493
- }
482
+ auto id = derived.Nominal ->getDistributedActorIDProperty ();
483
+ assert (id && " id must be synthesized first, so it is the first field of any "
484
+ " distributed actor (followed by actorSystem)" );
485
+
486
+ derived.addMemberToConformanceContext (pbDecl, /* hint=*/ id);
487
+ derived.addMemberToConformanceContext (propDecl, /* hint=*/ id);
494
488
495
489
return propDecl;
496
490
}
0 commit comments