Commit Graph

17 Commits

Author SHA1 Message Date
Allan Shortlidge
cb578172ea Tests: Remove -disable-availability-checking in more tests that use concurrency.
Use the `%target-swift-5.1-abi-triple` substitution to compile the tests for
deployment to the minimum OS versions required for use of _Concurrency APIs,
instead of disabling availability checking.
2024-10-19 12:35:20 -07:00
Doug Gregor
eeeea49764 Remove -enable-experimental-concurrency almost everywhere. 2021-07-26 21:24:43 -07:00
Doug Gregor
1e2012d816 Disable availability checking in tests that use concurrency 2021-07-20 12:46:26 -07:00
Doug Gregor
06dc77ddf3 Revert "[Concurrency] Resyntax 'async let' as 'spawn let'."
This reverts commit 41f42fabbf.
2021-05-06 22:18:36 -07:00
Doug Gregor
41f42fabbf [Concurrency] Resyntax 'async let' as 'spawn let'.
This helps track the proposal.
2021-04-29 23:28:16 -07:00
Kavon Farvardin
4f6eb85fe3 allow type initializers to be 'async'
implicit calls to an async super.init are not allowed
2021-04-15 10:08:53 -07:00
Kavon Farvardin
7825e37e19 [test] update regression test for effectful props
With effectful properties, we'll now raise an error if
an effect specifier appears on a non-'get' accessor.
2021-03-26 07:54:53 -07:00
Rintaro Ishizaki
31595e3b2b [Parse] Adjust diagnostics message for duplicated effects specifiers 2020-12-14 14:58:30 -08:00
Rintaro Ishizaki
c72f9e5c92 [Parse] Adjust diagnostics for effects specifiers in closure signature 2020-12-14 12:43:50 -08:00
Rintaro Ishizaki
4284a51589 [Parse/CodeCompletion] Implement effects specifier completion
Rewrote and rename 'parseAsyncThrows' to 'parseEffectsSpecifiers'.
Implemented 'CodeCompletionCallbacks::completeEffectsSpecifier()'
2020-12-14 12:38:15 -08:00
Evan Wilde
85810277f2 [Concurrency] Fix fix-it for async after ->
The `async` was being incorrectly consumed in `parseType` and as a
result, was not getting propagated back up to `parseFunctionSignature`
to be emitted as an error. Unless the next token is an arrow or a
throws, we don't consume it.
2020-12-11 15:12:26 -08:00
Doug Gregor
9722df86e8 [Concurrency] Require references to 'async let' to have an 'await'.
Extend effects checking to ensure that each reference to a variable
bound by an 'async let' is covered by an "await" expression and occurs
in a suitable context.
2020-11-04 17:32:04 -08:00
Doug Gregor
7f738778b8 [Concurrency] Parse 'async let' declarations.
Perform very basic semantic analysis for their well-formedness.
2020-11-04 17:31:31 -08:00
John McCall
a8464dcaf1 Implicitly import _Concurrency under -enable-experimental-concurrency 2020-10-22 00:53:15 -04:00
Doug Gregor
dd075c64c9 [Concurrency] Treat 'await' as a contextual keyword.
Replace the uglified '__await' keyword with a contextual keyword
'await'. This is more of what we would actually want for the
concurrency model.

When concurrency is enabled, this will be a source-breaking change,
because this is valid Swift code today:

```swift
  struct MyFuture<T> {
    func await() ->  }
    func doSomething() {
      let result = await()
    }
  }
```

but the call to `await()` will be parsed as an await expression when
concurrency is enabled. The source break is behind the experimental
concurrency flag, but this way we can see how much of an issue it is
in practice.
2020-08-13 10:34:51 -07:00
Doug Gregor
06d322b211 [Concurrency] Rename -enable-experimental-async.
Use the more general name `-enable-experimental-concurrency` instead,
since async is one part of the model.
2020-07-28 09:38:54 -07:00
Doug Gregor
f6e9f352f0 [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`
2020-07-27 18:18:03 -07:00