-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
swift macroFeature → declarations: Swift `macro` declarationsFeature → declarations: Swift `macro` declarations
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
sjavora, davdroman and m1guelpfjoshuawright11omochi, kntkymt and m1guelpf
Metadata
Metadata
Assignees
Labels
swift macroFeature → declarations: Swift `macro` declarationsFeature → declarations: Swift `macro` declarations