Skip to content

[Concurrency] Treat 'await' as a contextual keyword. #33457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 14, 2020

Conversation

DougGregor
Copy link
Member

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:

  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.

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.
@DougGregor
Copy link
Member Author

swiftlang/swift-syntax#236

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

swiftlang/swift-syntax#236

@swift-ci please smoke test

@DougGregor DougGregor merged commit f4082b9 into swiftlang:master Aug 14, 2020
@DougGregor DougGregor deleted the concurrency-contextual-await branch August 14, 2020 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant