mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-02 19:22:40 +00:00
fixes #8758, fixes #10828, fixes #12172, fixes #21610, fixes #23803, fixes #24633, fixes #24634, succeeds #24085 We simply track the symbol ID of every traversed `var`/`let` definition in `vmgen`, then these symbols are always considered evaluable in the current `vmgen` context. The set of symbols is reset before every generation, but both tests worked properly without doing this including the nested `const`, so maybe it's already done in some way I'm not seeing.
10 lines
132 B
Nim
10 lines
132 B
Nim
# issue #24633
|
|
|
|
import std/sequtils
|
|
|
|
proc f(a: static openArray[int]) =
|
|
const s1 = a.mapIt(it)
|
|
const s2 = a.toSeq()
|
|
|
|
f([1,2,3])
|