You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nim c -r --verbosity\:0 --hint\[Processing\]\:off --excessiveStackTrace\:on /home/deech/Nim/functest.nim
/home/deech/Nim/functest.nim(2, 8) Hint: 'result' is declared but not used [XDeclaredButNotUsed]
Traceback (most recent call last)
/home/deech/Nim/functest.nim(4) functest
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Segmentation fault
Error: execution of an external program failed: '/home/deech/Nim/functest '
Expected Output
hello world
Additional Information
Changing it to this works but the compiler should catch the above:
Nim Compiler Version 1.5.1 [Linux: amd64]
Compiled at 2021-07-12
Copyright (c) 2006-2021 by Andreas Rumpf
git hash: 195300a938c7c8dd4ec7db3ca7cc76dddeab953e
active boot switches: -d:release
The text was updated successfully, but these errors were encountered:
I think the bug here is that in the first example result is manually initialized but the compiler doesn't see that proc result() ... and result = proc () ... are equivalent.
that proc result() ... and result = proc () ... are equivalent.
They are not equivalent at all. In one case you declare a proc named result (i.e. the builtin result is shadowed), in the other case you assign an anon proc to result.
Example
Current Output
Expected Output
Additional Information
Changing it to this works but the compiler should catch the above:
The text was updated successfully, but these errors were encountered: