In Xcode 16.3 #toString(TypeName) stopped to work, compilation throws 'Expected member name or initializer call after type name' error. Everything works fine in Xcode 16.2.
The following works in both Xcode versions:
I think the reason is that the compiler strengthened the call-site syntax checking. And TypeName as a whole expression is not a valid reference to anything.
You probabibly need to invoke your macro with #toString(TypeName.self), and also adjust the macro implementation.
The behavior is correct: expression macro parameters should be type-checked before the macro expansion is performed.
Actually, this is Xcode 16.3 which does it correctly and fixes some previously missing checks.
can you please show what type of error is bring thrown around in 16.3
Actually in the coming days there might be a posibility of changes being made to the macro behaviour at compiler level and if we are able to catch this anomaly beforehand it will be benificial for us when we are making changes.
But as I wrote in my previous post, Xcode 16.3 does everything correctly. I know that now, thanks Apple, they reacted on my feedback on the problem quite swiftly.
Expression macro expects a correct expression and just Int is not correct one. I edited macro to process TypeName.self: