Downgrading the $-prefix error to a warning

I frequently use the "Inline macro" feature to debug or experiment with a macro. This is a fantastic feature that sets Swift macros apart. However, there is an annoyance: $-prefixed properties. Because these generate errors, it is not possible to quickly experiment with the macro implementation without changing a bunch of external references.

Is it at all possible to downgrade that error to a warning? Or are there major downsides to allowing this even with a warning?

The intention of the dollar-prefixed variables is that the compiler knows they can’t be used by user-written code. This, for example, allows a macro to guarantee that a local variable it introduces (exactly the ones with the dollar name that you are seeing), isn’t shadowing an outer variable.

2 Likes