Open ggb-sw opened 9 months ago
Using newLit
on ret
before passing it to quote works
@metagn my issue was not about how to mitigate the issue (I have other mitigations I have used) but whether it is designed behaviour that the macro should convert a named tuple to an unnamed tuple, and if so under what other circumstances would one expect a macro to change the type of value it is using?
In the first place I don't think you are supposed to embed values that aren't NimNode
in quote
blocks. The macro isn't removing the names from the named tuple, the NimNode serialization in the VM for values like ret
does, which is what quote
happens to use here, which gets exposed when it treats ret
like an untyped NimNode
@metagn I take your point that it probably is not the quote itself, because if it were the quote then macro test1
would also have the same outcome.
The question then is why is the VM stripping the names from the named tuple without giving me any warning that I am doing anything wrong?
It probably should warn when quoting non-NimNode symbols.
Description
Nim Version
Current Output
Expected Output
Possible Solution
No response
Additional Information
No response