Turned out that this is Xcode 16.3 which does it correctly.
According to the Expression Macros design, macro parameters should be type-checked, so the macro implementation doesn't receive incorrect code as input.
Thus Xcode <=16.2 erroneously allowed the wrong expression to be passed into my macro implementation, and this is fixed in Xcode 16.3.
Topic:
Programming Languages
SubTopic:
Swift
Tags: