Skip to content

Commit d4df6a3

Browse files
committed
[Distributed] Re-enable runtime tests
1 parent 2ccf3a2 commit d4df6a3

12 files changed

+22
-29
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4459,10 +4459,10 @@ NOTE(actor_isolated_sync_func,none,
44594459
"implicitly asynchronous",
44604460
(DescriptiveDeclKind, DeclName))
44614461
NOTE(distributed_actor_isolated_method_note,none,
4462-
"only 'distributed' functions can be called from outside the distributed actor", // TODO: improve error message
4462+
"only 'distributed' functions can be called from outside the distributed actor", // TODO(distributed): improve error message
44634463
())
44644464
ERROR(distributed_actor_isolated_method,none,
4465-
"only 'distributed' functions can be called from outside the distributed actor", // TODO: improve error message to be more like 'non-distributed' ... defined here
4465+
"only 'distributed' functions can be called from outside the distributed actor", // TODO(distributed): improve error message to be more like 'non-distributed' ... defined here
44664466
())
44674467
ERROR(distributed_actor_func_param_not_codable,none,
44684468
"distributed function parameter '%0' of type %1 does not conform to 'Codable'",

lib/Sema/CodeSynthesisDistributedActor.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ AbstractFunctionDecl *TypeChecker::addImplicitDistributedActorRemoteFunction(
175175
// nonisolated
176176
remoteFuncDecl->getAttrs().add(new (C) NonisolatedAttr(/*IsImplicit=*/true));
177177

178+
// nonisolated
179+
remoteFuncDecl->getAttrs().add(
180+
new (C) NonisolatedAttr(/*IsImplicit=*/true));
181+
178182
// users should never have to access this function directly;
179183
// it is only invoked from our distributed function thunk if the actor is remote.
180184
remoteFuncDecl->setUserAccessible(false);

lib/Sema/TypeCheckConcurrency.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ namespace {
13841384
decl->diagnose(diag::distributed_actor_isolated_method_note);
13851385
}
13861386
} else if (auto func = dyn_cast<AbstractFunctionDecl>(decl)) {
1387-
func->diagnose(diag::actor_isolated_sync_func, // FIXME: this is emitted wrongly for self.hello()
1387+
func->diagnose(diag::actor_isolated_sync_func,
13881388
decl->getDescriptiveKind(),
13891389
decl->getName());
13901390

test/Distributed/Runtime/distributed_actor_deinit.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@
1313
import _Distributed
1414

1515
@available(SwiftStdlib 5.5, *)
16-
actor A {}
16+
actor A {}
1717

1818
@available(SwiftStdlib 5.5, *)
1919
distributed actor DA {
2020
init(transport: ActorTransport) {
21-
defer { transport.actorReady(self) }
21+
defer { transport.actorReady(self) } // FIXME(distributed): rdar://81783599 this should be injected automatically
2222
}
2323
}
2424

2525
@available(SwiftStdlib 5.5, *)
2626
distributed actor DA_userDefined {
2727
init(transport: ActorTransport) {
28-
defer { transport.actorReady(self) }
28+
defer { transport.actorReady(self) } // FIXME(distributed): rdar://81783599 this should be injected automatically
2929
}
3030

3131
deinit {}
@@ -34,7 +34,7 @@ distributed actor DA_userDefined {
3434
@available(SwiftStdlib 5.5, *)
3535
distributed actor DA_userDefined2 {
3636
init(transport: ActorTransport) {
37-
defer { transport.actorReady(self) }
37+
defer { transport.actorReady(self) } // FIXME(distributed): rdar://81783599 this should be injected automatically
3838
}
3939

4040
deinit {
@@ -49,7 +49,7 @@ distributed actor DA_state {
4949
var age = 42
5050

5151
init(transport: ActorTransport) {
52-
defer { transport.actorReady(self) }
52+
defer { transport.actorReady(self) } // FIXME(distributed): rdar://81783599 this should be injected automatically
5353
}
5454

5555
deinit {

test/Distributed/Runtime/distributed_actor_dynamic_remote_func.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
// UNSUPPORTED: use_os_stdlib
88
// UNSUPPORTED: back_deployment_runtime
99

10-
// REQUIRES: rdar78290608
11-
1210
import _Distributed
1311

1412
@available(SwiftStdlib 5.5, *)
1513
distributed actor LocalWorker {
14+
init(transport: ActorTransport) {
15+
defer { transport.actorReady(self) } // FIXME(distributed): rdar://81783599 this should be injected automatically
16+
}
17+
1618
distributed func function() async throws -> String {
1719
"local:"
1820
}
@@ -25,13 +27,13 @@ distributed actor LocalWorker {
2527
@available(SwiftStdlib 5.5, *)
2628
extension LocalWorker {
2729
@_dynamicReplacement(for: _remote_function())
28-
// TODO: @_remoteDynamicReplacement(for: function()) - could be a nicer spelling, hiding that we use dynamic under the covers
30+
// TODO(distributed): @_remoteDynamicReplacement(for: function()) - could be a nicer spelling, hiding that we use dynamic under the covers
2931
func _cluster_remote_function() async throws -> String {
3032
"\(#function):"
3133
}
3234

3335
@_dynamicReplacement(for: _remote_echo(name:))
34-
// TODO: @_remoteDynamicReplacement(for: hello(name:)) - could be a nicer spelling, hiding that we use dynamic under the covers
36+
// TODO(distributed): @_remoteDynamicReplacement(for: hello(name:)) - could be a nicer spelling, hiding that we use dynamic under the covers
3537
func _cluster_remote_echo(name: String) async throws -> String {
3638
"\(#function):\(name)"
3739
}
@@ -95,7 +97,7 @@ func test_remote() async throws {
9597
let address = ActorAddress(parse: "")
9698
let transport = FakeTransport()
9799

98-
let worker = try LocalWorkerresolve(.init(address), using: transport)
100+
let worker = try LocalWorker.resolve(.init(address), using: transport)
99101
let x = try await worker.function()
100102
print("call: \(x)")
101103
// CHECK: call: _cluster_remote_function():

test/Distributed/Runtime/distributed_actor_init_local.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// UNSUPPORTED: use_os_stdlib
99
// UNSUPPORTED: back_deployment_runtime
1010

11-
// REQUIRES: rdar78290608
12-
1311
import _Distributed
1412

1513
@available(SwiftStdlib 5.5, *)

test/Distributed/Runtime/distributed_actor_isRemote.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// UNSUPPORTED: use_os_stdlib
99
// UNSUPPORTED: back_deployment_runtime
1010

11-
// REQUIRES: rdar78290608
12-
1311
import _Distributed
1412

1513
@available(SwiftStdlib 5.5, *)

test/Distributed/Runtime/distributed_actor_local.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
// UNSUPPORTED: use_os_stdlib
99
// UNSUPPORTED: back_deployment_runtime
1010

11-
// REQUIRES: rdar78290608
12-
1311
import _Distributed
1412

1513
@available(SwiftStdlib 5.5, *)

test/Distributed/Runtime/distributed_actor_remote_fieldsDontCrashDeinit.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
// UNSUPPORTED: use_os_stdlib
99
// UNSUPPORTED: back_deployment_runtime
1010

11-
1211
import _Distributed
1312

1413
@available(SwiftStdlib 5.5, *)

test/Distributed/Runtime/distributed_actor_remote_functions.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,7 @@ struct FakeTransport: ActorTransport {
149149
fatalError("not implemented:\(#function)")
150150
}
151151

152-
func resolve<Act>(_ identity: AnyActorIdentity, as actorType: Act.Type)
153-
throws -> Act?
152+
func resolve<Act>(_ identity: AnyActorIdentity, as actorType: Act.Type) throws -> Act?
154153
where Act: DistributedActor {
155154
return nil
156155
}

0 commit comments

Comments
 (0)