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).
Error: internal error: expr: param not init v_4602025
Expected Output
Compilation should succeed
Possible Solution
Defining a named proc and passing the proc by name works fine.
Using a proc instead of a template works fine.
Additional Information
This bug is only present on the 1.2 branch of Nim.
On 1.4, the bug has been fixed as of 341be0b61cc0603dc921c99b891208dcda274c98.
Backporting said commit on top of 1.2 fixes the bug, but this may introduce breaking changes as the AST representation of procs is modified.
$ nim -v
Nim Compiler Version 1.2.13 [MacOSX: amd64]
Compiled at 2021-08-05
Copyright (c) 2006-2020 by Andreas Rumpf
git hash: 76560576d2dd8ab1876fd4f81029d55467088354
active boot switches: -d:release
Passing an anonymous proc to a template may fail under Nim 1.2.12.
Example
Current Output
Expected Output
Compilation should succeed
Possible Solution
Additional Information