-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
internal error in genRdVar in vmgen.nim #14645
Comments
It seems related to static[T]. Here's a reduced case: import strformat
proc re(s: static string): string = s
proc p =
const rx = re(&"") |
I think it might not be related to static: proc p =
const rx = block:
var fmtRes_14356029 = ""
fmtRes_14356029 fails as well |
Is this a duplicate of #12172 ? |
probably not because top example produces whereas #12172 gives a different error note: top example a bit reduced (without iterator): import regex, strformat
proc p =
const rx = re(&"") |
AFAICS, your example has nothing to do with this defect, which is about a specific error message (a failure at a specific line in the compiler). |
nitely previously posted a reduced case without the iterator and without importing regex: import strformat
proc re(s: static string): string = s
proc p =
const rx = re(&"") |
@jibal btw, here is a workaround: import strformat
import regex
proc reCt(s: string): Regex {.compileTime.} = re(s)
proc p =
const rx = reCt(&"") |
here's the most straightforward way to circumvent this bug: when true: # gitissue
import strformat
proc re(s: static string): string = s
proc p =
# const rx = re(&"") # BUG
const rx = re(static(&"")) # ok that might help for PR that would fix this |
nim 1.2 on Windows
This code
produces this error message:
Error: internal error: (filename: "vmgen.nim", line: 1642, column: 22)
Note that this is the regex module from nimble ... it compiles regular expressions at compile time.
In reducing my actual code to a minimal failing case, I found that the iterator and the content of the string don't matter, but
const
, the calls tore
and&
(orfmt
), as well as being inside aproc
, are all necessary to produce the failure.The text was updated successfully, but these errors were encountered: