@xwu Thank you for sharing your interesting article.
What confused me was that AST generated by swift-syntax
is PrefixOperatorExpr '-'
followed by IntegerLiteralExpr '1'
.
Also I thought that the parser could theoretically re-parse it and the type-checker could re-consider it as generally expected even if the lexer recognize it as an integer literal.
Now I understand negative numeric literals have special treatment (which I doubt is good idea).
I completely forgot that I had already read the related thread... (thanks @benrimmington )
Nevertheless macro overload solution seems to have potentially some bugs.