"Macro expansion cannot introduce extension"?

Ah yeah, from here:

extension declarations can never be produced by a macro. The effect of an extension declaration is wide-ranging, with the ability to add conformances, members, and so on. These capabilities are meant to be introduced in a more fine-grained manner.

I think it's understandable to prohibit arbitrary extensions, but it seems perfectly reasonable to allow extensions for predefined types that ship with the same library that ships the macro. Does another macro provide the functionality for adding members to a library type? Should there be one?

4 Likes