Skip to content

Commit a67824f

Browse files
committed
[Distributed] More descriptive kind usage for error messages
1 parent 18bf8e0 commit a67824f

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4508,10 +4508,10 @@ ERROR(distributed_actor_func_param_not_codable,none,
45084508
"distributed instance method parameter '%0' of type %1 does not conform to 'Codable'",
45094509
(StringRef, Type))
45104510
ERROR(distributed_actor_func_result_not_codable,none,
4511-
"distributed instance method result type %0 does not conform to 'Codable'",
4512-
(Type))
4511+
"%0 result type %0 does not conform to 'Codable'",
4512+
(DescriptiveDeclKind, Type))
45134513
ERROR(distributed_actor_remote_func_implemented_manually,none,
4514-
"distributed function's %0 remote counterpart %1 cannot not be implemented manually.",
4514+
"distributed instance method's %0 remote counterpart %1 cannot not be implemented manually.",
45154515
(Identifier, Identifier))
45164516
ERROR(nonisolated_distributed_actor_storage,none,
45174517
"'nonisolated' can not be applied to distributed actor stored properties",
@@ -4532,7 +4532,7 @@ ERROR(distributed_actor_func_variadic, none,
45324532
"%0 %1 cannot declare variadic argument %2",
45334533
(DescriptiveDeclKind, DeclName, DeclName))
45344534
ERROR(distributed_actor_remote_func_is_not_static,none,
4535-
"remote function %0 must be static.",
4535+
"remote function %0 must be static",
45364536
(DeclName))
45374537
ERROR(distributed_actor_remote_func_is_not_async_throws,none,
45384538
"remote function %0 must be 'async throws'.",

lib/Sema/TypeCheckDistributed.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ bool swift::checkDistributedFunction(FuncDecl *func, bool diagnose) {
155155
if (diagnose)
156156
func->diagnose(
157157
diag::distributed_actor_func_result_not_codable,
158+
func->getDescriptiveKind(),
158159
func->getResultInterfaceType()
159160
);
160161
// TODO: suggest a fixit to add Codable to the type?

test/Distributed/distributed_actor_inference.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ distributed actor SomeDistributedActor_6 {
6868

6969
@available(SwiftStdlib 5.6, *)
7070
distributed actor SomeDistributedActor_7 {
71-
distributed func dont_1() async throws -> Int { 42 } // expected-error{{distributed instance method's'dont_1' remote counterpart '_remote_dont_1' cannot not be implemented manually.}}
72-
distributed func dont_2() async throws -> Int { 42 } // expected-error{{distributed instance method's'dont_2' remote counterpart '_remote_dont_2' cannot not be implemented manually.}}
73-
distributed func dont_3() async throws -> Int { 42 } // expected-error{{distributed instance method's'dont_3' remote counterpart '_remote_dont_3' cannot not be implemented manually.}}
71+
distributed func dont_1() async throws -> Int { 42 } // expected-error{{distributed instance method's 'dont_1' remote counterpart '_remote_dont_1' cannot not be implemented manually.}}
72+
distributed func dont_2() async throws -> Int { 42 } // expected-error{{distributed instance method's 'dont_2' remote counterpart '_remote_dont_2' cannot not be implemented manually.}}
73+
distributed func dont_3() async throws -> Int { 42 } // expected-error{{distributed instance method's 'dont_3' remote counterpart '_remote_dont_3' cannot not be implemented manually.}}
7474
}
7575

7676
@available(SwiftStdlib 5.6, *)

0 commit comments

Comments
 (0)