[swift-evolution] User Defined Attributes/Annotations

Chris Lattner clattner at apple.com
Thu Dec 10 23:09:01 CST 2015

> On Dec 9, 2015, at 9:40 PM, Akiva Leffert via swift-evolution <swift-evolution at swift.org> wrote:
> Hi,
> I’m interested in adding user defined annotations. For example,
> 	```
> 	@MyAnnotation func foo() {
> 	}
> 	```
> This would help enable third party linting and behavioral documentation. This is useful in its own right, but it can also help inform the future direction of static checks within the language.

Quick feedback: I’d love to see Swift have this sort of functionality someday, but when it exists, it should almost certainly tie into the reflection system.  One of our stretch goals for Swift 3 is to rework the "mirror” APIs into a proper reflection system, and the design of user-defined annotations should wait until that settles out IMO.


More information about the swift-evolution mailing list