Swift macros are an experimental feature, so you need the pre-release Swift toolchain, but that is all you need to integrate it into a real project and use it as a test library.
Help needed!
Currently, Swift macros manipulate the SwiftSyntax syntax tree, and since the syntax tree does not contain type information, this library heuristically analyses the code for various code patterns.
However, since any code can be passed to the assert function, there must still be many unexpected patterns.
Try out this library and help us validate different code patterns. If you find a pattern that doesn't work correctly, please tell us about it in an issue on GitHub.
I'm a big fan of Spock's assertion error messages. Any chance of changing the spelling to #expect(foo == bar) instead of #powerAssert? I just find it a bit verbose.
Thanks, #expect seems good. Actually, I wanted to simply use #assert, but Swift's macros don't expand #assert, so I had no choice but to use #powerAssert.
Thank you. I am a little worried that if the Compile Time Assertion feature will be officially accepted, it will take precedence over the Compile Time Assertion feature than macro?
Or if Compile Time Assertion is accepted, it will use a different syntax?