vm string literals do not work when generated by a macro
Closed this issue · 0 comments
krux02 commented
Example
macro fooImpl(arg: untyped) =
result = quote do:
`arg`
proc foo(): string {.compileTime.} =
fooImpl:
result = "foo"
result.addInt 4
static:
echo foo()
echo foo()
echo foo()Current Output
foo4
foo44
foo444
Expected Output
foo4
foo4
foo4
Additional Information
- It was working in version v.20.0
- This issue broke my project https://github.com/krux02/opengl-sandbox
- This issue has severe consequences for https://github.com/krux02/ast-pattern-matching as all code bodies are forwarded to a macro as in the example above.
$ nim -v
Nim Compiler Version 1.1.1 [Linux: amd64]
Compiled at 2019-11-14
Copyright (c) 2006-2019 by Andreas Rumpf
git hash: e69a69852b1028017139114a2444de83630c1505
active boot switches: -d:danger