-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[DNM][Distributed] Handle generic actors and Codable better #71467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…computeSubstitutions` This is going to be used to determine whether the substitutions are computed for `DistributedActorSystem::remoteCall` and adjust the generic signature with witness conformance requirements.
…irement of distributed actor system
…f `DistributedActorSystem.remoteCall` Conformance requirement between on `Res` and `SerializationRequirement` of `DistributedActorSystem.remoteCall` are not expressible at the moment but they are verified by Sema so it's okay to omit them here and lookup dynamically during IRGen.
…tributedActorSystem.remoteCall` witness
…tedActorSystem.remoteCall` witnesses When IRGen is building a protocol witness thunk for a `DistributedActorSystem.remoteCall` requirement we need to supply witness tables associated with `Res` generic parameter which are not expressible on the requirement because they come from `SerializationRequirement` associated type.
@swift-ci please smoke test |
@@ -763,6 +762,30 @@ addDistributedActorCodableConformance( | |||
return nullptr; | |||
} | |||
|
|||
if (actor->isGeneric()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want isGeneric() or isGenericContext()?
|
||
assert(proto->isSpecificProtocol(swift::KnownProtocolKind::Decodable) || | ||
proto->isSpecificProtocol(swift::KnownProtocolKind::Encodable)); | ||
|
||
// === Does the actor explicitly conform to the protocol already? | ||
auto explicitConformance = | ||
module->lookupConformance(actor->getInterfaceType(), proto); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will always return false because getInterfaceType() returns a metatype given a TypeDecl
Thanks Slava, I'll be looking into this one deeper next |
This builds on top of #71435
And adds the last commit which cleans up our "implicit codable" logic.
I think this is probably good enough tbh -- see test cases @xedin
The commit: 5f669bb