Open liquidev opened 4 years ago
this would be fixed by https://github.com/nim-lang/Nim/issues/13830 as many other things:
note: @liquid600pgm please always reduce your example; here's a reduced one:
when true:
# macro entity(entityType: untyped) = discard
macro entity(entityType: typed) = discard
type Player {.entity.} = object
x: int
gives:
Error: invalid expression: Player {..} = object
with macro entity(entityType: untyped) = discard
it also doesn't work with a different error:
Error: illformed AST:
Related: #18864, workaround outlined in https://github.com/nim-lang/Nim/issues/18864#issuecomment-1695215373
Example
Current Output
Expected Output
Successful compilation. Expected behavior would be similar to procs. You cannot re-emit a procedure's AST after it's been sem-checked, but you are still able to read it with all the idents resolved (which is what I'm trying to do):
Additional Information