Open Quelklef opened 4 years ago
import os for unused_var in walkDir("."): let outside = "x" let closure = proc(): string = outside
Hint: used config file '/playground/nim/config/nim.cfg' [Conf] Hint: system [Processing] Hint: widestrs [Processing] Hint: io [Processing] Hint: in [Processing] Hint: os [Processing] Hint: strutils [Processing] Hint: parseutils [Processing] Hint: math [Processing] Hint: bitops [Processing] Hint: macros [Processing] Hint: algorithm [Processing] Hint: unicode [Processing] Hint: pathnorm [Processing] Hint: osseps [Processing] Hint: posix [Processing] Hint: times [Processing] Hint: options [Processing] Hint: typetraits [Processing] /usercode/in.nim(5, 7) Hint: 'closure' is declared but not used [XDeclaredButNotUsed] Hint: gcc -c -w -I/playground/nim/lib -I/usercode -o /usercode/nimcache/stdlib_assertions.nim.c.o /usercode/nimcache/stdlib_assertions.nim.c [Exec] Hint: gcc -c -w -I/playground/nim/lib -I/usercode -o /usercode/nimcache/stdlib_system.nim.c.o /usercode/nimcache/stdlib_system.nim.c [Exec] Hint: gcc -c -w -I/playground/nim/lib -I/usercode -o /usercode/nimcache/stdlib_pathnorm.nim.c.o /usercode/nimcache/stdlib_pathnorm.nim.c [Exec] Hint: gcc -c -w -I/playground/nim/lib -I/usercode -o /usercode/nimcache/stdlib_times.nim.c.o /usercode/nimcache/stdlib_times.nim.c [Exec] Hint: gcc -c -w -I/playground/nim/lib -I/usercode -o /usercode/nimcache/stdlib_os.nim.c.o /usercode/nimcache/stdlib_os.nim.c [Exec] Hint: gcc -c -w -I/playground/nim/lib -I/usercode -o /usercode/nimcache/@min.nim.c.o /usercode/nimcache/@min.nim.c [Exec] /usercode/nimcache/@min.nim.c: In function 'colonanonymous___joSqnaeyrUqFaMMdrvJu0A': /usercode/nimcache/@min.nim.c:495:22: error: 'outside__XaBgCwy9aLkuI2Qj5G8ldCA_2' undeclared (first use in this function) result = copyString(outside__XaBgCwy9aLkuI2Qj5G8ldCA_2); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usercode/nimcache/@min.nim.c:495:22: note: each undeclared identifier is reported only once for each function it appears in Error: execution of an external program failed: 'gcc -c -w -I/playground/nim/lib -I/usercode -o /usercode/nimcache/@min.nim.c.o /usercode/nimcache/@min.nim.c'
No compiler crash
walkDir
outside
$ nim -v Nim Compiler Version 0.3.5 [Linux: amd64] git hash: cbd78ec1f68e78a88e4a83a5009bc4c8c28c79b3
It's not clear to me why walkDir is special, but the os module was pretty resistant to me trying to crack it open and find out.
os
Example
Current Output
Expected Output
No compiler crash
Possible Solution
Additional Information
walkDir
outside
is declared globally