Having a macro introduce arbitrary conformances are something we were trying to get away from. "Does type X
conform to protocol P
?" is a question often asked in the compiler, and a macro that can possibly answer that question for every P
will be expanded nearly all the time. That's both a compile-time performance issue, and also can introduce cyclic dependencies in type checking when that macro has interesting arguments.
We could allow the same prefixed(X)
and suffixed(X)
forms in the conformances
list that we do for names
, so one can generate a protocol and a conformance to it together, with a name derived from the entity to which the macro is attached.
Doug