You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
assertMacroExpansion() gives different diagnostics than using a macro when attached to multiple variables #3320
When testing macros attached to properties where there are multiple properties on the same var/let, assertMacroExpansion() gives an error before executing the macro. But when using the macro outside of assertMacroExpansion(), the macro is executed similarly to when there is only one property.
If this code is placed in regularly executing Swift, it runs without issues and the return-statement is hit twice, for both a and b. But if it executed through assertMacroExpansion(), a diagnostic is raised stating that peer macro can only be applied to a single variable, and the macro code is never executed.
Activity
akasakariko commentedon Oct 31, 2026
I'd like to work on this