Skip to content

Wrong diagnostic with async throws property #59614

Open
@NachoSoto

Description

@NachoSoto

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)

Metadata

Metadata

Assignees

Labels

accessorsFeature → declarations: Variable (property) accessorsasync & awaitFeature → concurrency: asynchronous function aka the async/await patternbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfconcurrencyFeature: umbrella label for concurrency language featuresdeclarationsFeature: declarationsdiagnostics QoIBug: Diagnostics Quality of ImplementationparserArea → compiler: The legacy C++ parserswift 6.0

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions