mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Distributed] Improve erroring out when distributed types not found
also return early when type hasError
This commit is contained in:
@@ -81,15 +81,15 @@ static VarDecl*
|
||||
// what already has a witness.
|
||||
static VarDecl *addImplicitDistributedActorIDProperty(
|
||||
ClassDecl *nominal) {
|
||||
if (!nominal)
|
||||
return nullptr;
|
||||
if (!nominal->isDistributedActor())
|
||||
if (!nominal || !nominal->isDistributedActor())
|
||||
return nullptr;
|
||||
|
||||
auto &C = nominal->getASTContext();
|
||||
|
||||
// ==== Synthesize and add 'id' property to the actor decl
|
||||
Type propertyType = getDistributedActorIDType(nominal);
|
||||
if (!propertyType || propertyType->hasError())
|
||||
return nullptr;
|
||||
|
||||
auto *propDecl = new (C)
|
||||
VarDecl(/*IsStatic*/false, VarDecl::Introducer::Let,
|
||||
|
||||
Reference in New Issue
Block a user