Skip to content
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

Wrong diagnostic with async throws property #59614

Open
NachoSoto opened this issue Jun 21, 2022 · 1 comment
Open

Wrong diagnostic with async throws property #59614

NachoSoto opened this issue Jun 21, 2022 · 1 comment
Assignees
Labels
accessors Feature → declarations: Variable (property) accessors async & await Feature → concurrency: asynchronous function aka the async/await pattern bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself concurrency Feature: umbrella label for concurrency language features declarations Feature: declarations diagnostics QoI Bug: Diagnostics Quality of Implementation parser Area → compiler: The legacy C++ parser swift 6.0

Comments

@NachoSoto
Copy link
Contributor

NachoSoto commented Jun 21, 2022

To Reproduce

struct A {
    var p: Int {
        async get throws { return 0 }
    }
}

Expected behavior

  • Fix-it to replace async get throws with get async throws

Actual behavior

error: repl.swift:3:9: error: found 'async' in expression; did you mean 'await'?
        async get throws {
        ^~~~~
        await

error: repl.swift:3:19: error: 'throws' may only occur before '->'
        async get throws {
                  ^

Environment

  • OS: macOS 13.0 beta 1
  • Swift version: 5.7 (swiftlang-5.7.0.113.202 clang-1400.0.16.2)
@NachoSoto NachoSoto added the bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. label Jun 21, 2022
@etcwilde etcwilde self-assigned this Jun 22, 2022
@NachoSoto
Copy link
Contributor Author

@etcwilde FYI this is still broken on Swift 6.

@AnthonyLatsis AnthonyLatsis added concurrency Feature: umbrella label for concurrency language features parser Area → compiler: The legacy C++ parser compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation async & await Feature → concurrency: asynchronous function aka the async/await pattern accessors Feature → declarations: Variable (property) accessors declarations Feature: declarations swift 6.0 labels Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessors Feature → declarations: Variable (property) accessors async & await Feature → concurrency: asynchronous function aka the async/await pattern bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself concurrency Feature: umbrella label for concurrency language features declarations Feature: declarations diagnostics QoI Bug: Diagnostics Quality of Implementation parser Area → compiler: The legacy C++ parser swift 6.0
Projects
None yet
Development

No branches or pull requests

3 participants