Feedback wanted: confusing concurrency diagnostic messages

I find the compiler error "Task or actor isolated value cannot be sent" (discussed e.g. in this thread: Task or actor isolated value cannot be sent) confusing for grammar reasons.

I'm not a native English speaker, but I think this diagnostic should be as follows (note the added hyphens), to make clear that the task itself is not the problem:

"Task- or actor-isolated value cannot be sent"

or alternatively:

"Task-isolated or actor-isolated value cannot be sent"

It would be even better if the name of the variable that is being sent could be named in the diagnostic, e.g.:

"Task- or actor-isolated value 'myVar' cannot be sent"

It's sometimes not immediately clear to me which variable this is talking about. For example, this post from the thread mentioned above shows a screenshot where the diagnostic is attached rather generically to a Task closure rather than a specific expression in the closure body (perhaps because the isolated value in question in this case is the implicit 'self'?). If the closure body were longer than just a single expression, it would not be immediately apparent to which expression the diagnostic is referring.

9 Likes