Closed sxq112358 closed 1 year ago
Looks like this is the source of the error, but I don't have any idea what the cause is. dir
is defined on L506 and used shortly thereafter on L512:
Contributions/help investigating would be welcome for this one.
Minimal reproducible example
from sequtils import toSeq
iterator test(dir:int):int=
yield 1234
iterator walkGlobKinds (): int =
let dir = 123
let it = test(dir).toSeq() #fail
#let it3 = countup(0,dir,2).toSeq() #fail
#let it2 = collect:
# for i in test(dir):i #pass
#for i in test(dir):
# echo i #pass
proc main()=
let it = iterator():int=
for path in walkGlobKinds():
yield path
main()
the compiler bug has been fixed. nim issue link
Compile failed when use
walkGlob
orwalkGlobKinds
inside an iterator.when compiling, it gives the following error:
/home/***/.nimble/pkgs/glob-0.11.2/glob.nim(512, 33) Error: internal error: environment misses: dir
Nim Compiler Version 1.6.12 [Linux: amd64] on Archlinux and Nim Compiler Version 1.6.12 [Windows: amd64] on Windows11