Files
swift-mirror/test/Distributed/distributed_actor_basic.swift
Konrad `ktoso` Malawski 14c432c11d cleanup
2021-10-05 06:31:50 +09:00

36 lines
883 B
Swift

// RUN: %target-typecheck-verify-swift -enable-experimental-distributed -disable-availability-checking
// REQUIRES: concurrency
// REQUIRES: distributed
import _Distributed
distributed actor DA {
}
distributed actor First {
distributed func one(second: Second) async throws {
try await second.two(first: self, second: second)
}
}
distributed actor Second {
distributed func two(first: First, second: Second) async {
try! await first.one(second: self)
}
}
// ==== ------------------------------------------------------------------------
extension First {
@_dynamicReplacement (for :_remote_one(second:))
nonisolated func _impl_one(second: Second) async throws {
fatalError()
}
}
extension Second {
@_dynamicReplacement (for :_remote_two(first:second:))
nonisolated func _impl_two(first: First, second: Second) async throws {
fatalError()
}
}