Skip to content

Commit 79a3b58

Browse files
committed
[Distributed] After all, a private func may be distributed
1 parent 67cb7b7 commit 79a3b58

File tree

3 files changed

+0
-12
lines changed

3 files changed

+0
-12
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4519,9 +4519,6 @@ ERROR(nonisolated_distributed_actor_storage,none,
45194519
ERROR(distributed_actor_func_nonisolated, none,
45204520
"function %0 cannot be both 'nonisolated' and 'distributed'",
45214521
(DeclName))
4522-
ERROR(distributed_actor_func_private, none,
4523-
"%0 %1 cannot be 'private'",
4524-
(DescriptiveDeclKind, DeclName))
45254522
ERROR(distributed_actor_remote_func_is_not_static,none,
45264523
"remote function %0 must be static.",
45274524
(DeclName))

lib/Sema/TypeCheckDistributed.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,6 @@ bool swift::checkDistributedFunction(FuncDecl *func, bool diagnose) {
107107

108108
auto module = func->getParentModule();
109109

110-
if (func->getEffectiveAccess() == AccessLevel::FilePrivate) {
111-
func->diagnose(diag::distributed_actor_func_private,
112-
func->getDescriptiveKind(), func->getName());
113-
// TODO(distributed): fixit remove the 'private' from the declaration
114-
return true;
115-
}
116-
117110
// --- Check parameters for 'Codable' conformance
118111
for (auto param : *func->getParameters()) {
119112
auto paramTy = func->mapTypeIntoContext(param->getInterfaceType());

test/Distributed/distributed_actor_isolation.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ distributed actor DistributedActor_1 {
5252
// expected-error@-1{{class methods are only allowed within classes; use 'static' to declare a static method}}
5353
// expected-error@-2{{'distributed' method cannot be 'static'}} // TODO(distributed): should call out 'class' instead?
5454

55-
distributed private func distributedPrivate() {} //expected-error{{distributed instance method 'distributedPrivate()' cannot be 'private'}}
56-
5755
func hello() {} // expected-note{{distributed actor-isolated instance method 'hello()' declared here}}
5856
func helloAsync() async {} // expected-note{{distributed actor-isolated instance method 'helloAsync()' declared here}}
5957
func helloAsyncThrows() async throws {} // expected-note{{distributed actor-isolated instance method 'helloAsyncThrows()' declared here}}

0 commit comments

Comments
 (0)