Hi y'all!
I'm trying to get the https://github.com/andreaferretti/interfaced macros to work with the latest nim devel version. I got rid of the deprecation warnings and replaced all "RootRef" with "pointer" as suggested here: https://github.com/nim-lang/Nim/issues/20016
The modified fork is here: https://github.com/sdickreuter/interfaced
It works when I take the generated output from the macros (echo result.repr) and put it above the examples, as in this file here: https://github.com/sdickreuter/interfaced/blob/master/test_expanded.nim This compiles fine (nim --run compile test_expanded.nim).
But if I try to compile the original test (nim --run compile test), I get this error: /home/sei/git/interfaced/interfaced.nim(54, 20) Error: internal error: environment misses: this
I'm a bit in over my head with this, so hopefully someone here knows how to fix this.
Error: internal error: environment misses: this
Likely means you're emitting a symbol in a place that it should be an ident. I have not taken a look at trying to fix it but properly desyming the typed ast will likely solve it. Otherwise I can suggest https://github.com/beef331/traitor as an alternative.
Hi Beef,
thanks again for your help! I think I now better understand what the macro is actually doing, and at the moment I suspect it might be the same problem as here: https://github.com/nim-lang/Nim/issues/23466
I'll wait for a fix, and if it still won't work, I try it with traitor, which also looks very nice!
Just for reference:
I tried traitor as suggested by Beef and it works like a charm!