Can macros only add new variables or methods with fixed names?
Macros can add arbitrary names, except at the global scope:
@attached(member, names: arbitrary)
public macro MyMacro() = ...
From the book:
The macro declaration also includes
arbitraryafter the list of names, allowing the macro to generate declarations whose names aren’t known until you use the macro.
Unfortunately, I want to use a peer macro to generate a top level new type ...