mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Concurrency] Add async to the Swift type system.
Add `async` to the type system. `async` can be written as part of a
function type or function declaration, following the parameter list, e.g.,
func doSomeWork() async { ... }
`async` functions are distinct from non-`async` functions and there
are no conversions amongst them. At present, `async` functions do not
*do* anything, but this commit fully supports them as a distinct kind
of function throughout:
* Parsing of `async`
* AST representation of `async` in declarations and types
* Syntactic type representation of `async`
* (De-/re-)mangling of function types involving 'async'
* Runtime type representation and reconstruction of function types
involving `async`.
* Dynamic casting restrictions for `async` function types
* (De-)serialization of `async` function types
* Disabling overriding, witness matching, and conversions with
differing `async`
This commit is contained in:
@@ -373,6 +373,9 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
||||
Opts.EnableExperimentalStaticAssert |=
|
||||
Args.hasArg(OPT_enable_experimental_static_assert);
|
||||
|
||||
Opts.EnableExperimentalAsync |=
|
||||
Args.hasArg(OPT_enable_experimental_async);
|
||||
|
||||
Opts.EnableSubstSILFunctionTypesForFunctionValues |=
|
||||
Args.hasArg(OPT_enable_subst_sil_function_types_for_function_values);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user