Open
Description
The function body macro proposal states:
When using the shorthand syntax for get-only properties, a function body macro can be applied to the property itself:
But the following does not compile
@stringify // error: 'body' macro cannot be attached to var ('x')
var x: Int { 2 }
With stringify
being a function body macro.
Attaching a function body macro to a getter also doesn’t work:
var x: Int {
@stringify get { 1 } // error: Declaration is not a type with an optional code block
}
rdar://130739935