swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.58k stars 10.36k forks source link

Wrong diagnostic with `async throws` property #59614

Open NachoSoto opened 2 years ago

NachoSoto commented 2 years ago

To Reproduce

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

Expected behavior

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

NachoSoto commented 4 months ago

@etcwilde FYI this is still broken on Swift 6.