nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.55k stars 1.47k forks source link

[regression] The VM ref commit breaks strfmt compilation #8156

Closed kaushalmodi closed 6 years ago

kaushalmodi commented 6 years ago

This is the case even after building Nim using the recent https://github.com/nim-lang/Nim/commit/ae69e571e1c9c2ce5e29b938ad9c376c74b3cd5b commit.

I have verified that by reverting https://github.com/nim-lang/Nim/commit/236bc06b5f1a1a1fc4a711007aed0b60b6656a4f from a point before this recent fix was applied, strfmt package compiles fine.

But it fails compilation with the below error if I use either of these 2 Nim versions:

That means that the VM fix commit was not effective for this case.

image

To reproduce the issue:

git clone https://github.com/kaushalmodi/strfmt
cd strfmt
nimble test
stack trace: (most recent call last)
strfmt.nim(838)          fmt
strfmt.nim(824)          addfmtfmt
strfmt.nim(783)          generatefmt
strfmt.nim(1314, 9) template/generic instantiation from here
strfmt.nim(1323, 10) template/generic instantiation from here
strfmt.nim(1324, 7) template/generic instantiation from here
strfmt.nim(1332, 51) template/generic instantiation from here
strfmt.nim(783, 18) Error: Too few arguments for format string
stack trace: (most recent call last)
home/kmodi/sandbox/nim/strfmt/strfmt.nimble(19) testTask
home/kmodi/stow/pkgs/nim/bad/lib/system/nimscript.nim(237) exec
home/kmodi/stow/pkgs/nim/bad/lib/system/nimscript.nim(237, 7) Error: unhandled exception: FAILED: nim c -r strfmt.nim

Here's the strfmt.nim(838) line.

kaushalmodi commented 6 years ago

/cc @GULPF

kaushalmodi commented 6 years ago

@GULPF Thanks once again for fixing this. I confirm the fix.