Open
Description
Describe the bug
When import Distributed
is missing in a file which has distributed actor
with distributed func
in it, an seemingly unrelated error messages are produced:
error: type 'Greeter' does not conform to protocol 'Equatable'
...
<unknown>:0: error: cannot find '__isRemoteActor' in scope
<unknown>:0: error: cannot find 'RemoteCallTarget' in scope
To Reproduce
- Create a file with this content (assuming an implementation
YourClusterSystem
ofDistributedActorSystem
is in scope)
typealias DefaultDistributedActorSystem = YourClusterSystem
distributed actor Greeter {
distributed func hello() {
print("Hello, Distributed World!")
}
}
- Try to build and observe unrelated error messages that don't mention the missing import.
- Adding
import Distributed
in such file makes the errors go away.
Expected behavior
If import Distributed
is always needed in files that contain distributed actors, an error message that requires the import should be displayed. Unrelated diagnostics about missing Equatable
conformance shouldn't be displayed as it's confusing.
Environment:
OS: macOS 12.4 (21F79), but most likely reproducible on any platform that supports distributed actors.
Xcode Version/Tag/Branch: 13.4 (13F17a)
Toolchain: Swift Development Snapshot 2022-05-27, also reproducible with 5.7 Development Snapshot 2022-05-18 (a)