mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
In this case, what is happening is that in SILGen, we insert implicit DistributedActor.asLocalActor calls to convert a distributed actor to its local any Actor typed form. The intention is that the actor parameter and result are considered the same... but there is nothing at the SIL level to enforce that. In this commit, I change ActorInstance (the utility that defines actor identity at a value level) to look through such a call. I implemented this by just recognizing the decl directly. We already do this in parts of SILGen, so I don't really see a problem with doing this. It also provides a nice benefit that we do not have to modify SILFunctionType to represent this or put a @_semantic attribute on the getter. NOTE: Generally, Sema prevents us from mixing together different actors. In this case, Sema does not help us since this call is inserted implicitly by the distributed actor implementation in SILGen. So this is not a problem in general. rdar://152436817
56 KiB
56 KiB