Post

Replies

Boosts

Views

Activity

Reply to Swift Macros: Adding an enum case with an associated value produces incorrect results
Hi @MobileTen. Thanks for your comment. I'm not sure what you mean by "rewrite" the tree rather than "replace" it, though. In your linked video, one thing Alex does differently is initialize DeclSyntax nodes using explicit initializers rather than using plain strings. I haven't noticed a difference, though. When I replace return ["case bar(Bool)"] with return [DeclSyntax(try EnumCaseDeclSyntax("case bar(Int)"))], I continue to see the same issue. Can you elaborate on what I'm doing incorrectly?
Topic: Programming Languages SubTopic: Swift Tags:
Nov ’23