Attached Macros and Comparable Conformance Issues

From my experience, the current implementation (I'm using Xcode 15.1) doesn't work well when using macro and protocols having synthesized conformance together. I for one ran into a few odd issues (see #70086, #70087, #70181). Most of my issues were with extension macro and I used the same workaround as the one you found for a while. I gave up in the end because there are more issues with extension macro (see #69073 for example).

Now I mainly use member macros. In the places where I need extension macro, I use member macro this way:

@MyMemberMacro
extension Foo: FooProtocol {
}

The issue you reported is about member macro. I didn't run into it because (fortunately) I don't use compiler directive. It shows the issue with macro and synthesized conformance is general. I suspect the issue is well known by Apple engines and they have a long term plan on how to address it. But I haven't found any discussion about it.