mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The fix-it was being a little too eager to label function decls async. Computed properties, or AccessorDecls are function declarations, but they don't have parentheses, so trying to add `async` to them causes crashing. Furthermore, they can't be async at all, so suggesting that we make them async is just wrong. We shouldn't give folks a glimmer of hope where there is none to be had.
13 lines
332 B
Swift
13 lines
332 B
Swift
// RUN: %target-typecheck-verify-swift -enable-experimental-concurrency
|
|
// REQUIRES: concurrency
|
|
|
|
func asyncFunc(_ value: String) async {}
|
|
|
|
class ComputedPropertyClass {
|
|
var meep: String {
|
|
//expected-error@+1:11{{'async' call in a function that does not support concurrency}}
|
|
await asyncFunc("Meep")
|
|
return "15"
|
|
}
|
|
}
|