Skip to content

Fix grammar of infix expressions, to allow 'await'. #180

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 1 commit into from
Sep 12, 2023

Conversation

amartini51
Copy link
Member

Fixes: #179

This matches the grammar of top-level expressions, and is needed to
produce code like the following:

    func f() async throws -> Int { return 12 }
    var x: Int
    x = try await f()

On the last line, the code after the equals sign is an infix expression,
not a top level expression -- without this change to the grammar, it
wouldn't match.
@amartini51
Copy link
Member Author

@etcwilde @ktoso I'm pretty sure this change is correct — please see my comments on the GitHub issue for more details — but please take a look to confirm. Thanks!

Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think that's right 👍

Thanks!

@amartini51 amartini51 merged commit f24d984 into swiftlang:release/5.9 Sep 12, 2023
@amartini51 amartini51 deleted the await_grammar_179 branch September 12, 2023 23:39
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.

Grammar of "infix expression" does not allow await
3 participants