Skip to content

Commit 28af977

Browse files
authored
Merge pull request swiftlang#74284 from ktoso/wip-minor-improved-erroringout
2 parents 689e889 + 4bae14a commit 28af977

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/Sema/CodeSynthesisDistributedActor.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ static VarDecl*
8181
// what already has a witness.
8282
static VarDecl *addImplicitDistributedActorIDProperty(
8383
ClassDecl *nominal) {
84-
if (!nominal)
85-
return nullptr;
86-
if (!nominal->isDistributedActor())
84+
if (!nominal || !nominal->isDistributedActor())
8785
return nullptr;
8886

8987
auto &C = nominal->getASTContext();
9088

9189
// ==== Synthesize and add 'id' property to the actor decl
9290
Type propertyType = getDistributedActorIDType(nominal);
91+
if (!propertyType || propertyType->hasError())
92+
return nullptr;
9393

9494
auto *propDecl = new (C)
9595
VarDecl(/*IsStatic*/false, VarDecl::Introducer::Let,

lib/Sema/DerivedConformanceDistributedActor.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,9 @@ static ValueDecl *deriveDistributedActor_actorSystem(
474474
auto classDecl = dyn_cast<ClassDecl>(derived.Nominal);
475475
assert(classDecl && derived.Nominal->isDistributedActor());
476476

477+
if (!C.getLoadedModule(C.Id_Distributed))
478+
return nullptr;
479+
477480
// ```
478481
// nonisolated let actorSystem: ActorSystem
479482
// ```

0 commit comments

Comments
 (0)