Introduce checking for ConcurrentValue conformance across actors.

When referring to an actor-isolated declaration from outside of the
actor, ensure that the types involved conform to the `ConcurrentValue`
protocol. Otherwise, produce a diagnostic stating that it is unsafe to
pass such types across actors.

Apply the same rule to local captures within concurrent code.
This commit is contained in:
Doug Gregor
2021-02-01 12:13:31 -08:00
parent a632118d6a
commit 866a8d8944
14 changed files with 654 additions and 68 deletions

View File

@@ -385,6 +385,8 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
Opts.EnableExperimentalConcurrency |=
Args.hasArg(OPT_enable_experimental_concurrency);
Opts.EnableExperimentalConcurrentValueChecking |=
Args.hasArg(OPT_enable_experimental_concurrent_value_checking);
Opts.DisableImplicitConcurrencyModuleImport |=
Args.hasArg(OPT_disable_implicit_concurrency_module_import);