Closed
Description
While working on Futhark I wanted to decide whether or not to put something into a const
or a let
. Basically it tries to read out macros which can resolve to simple numbers and I want those to be consts, but it can also be other stuff which can't go into a const. I came if with a solution of using when x is static: const y = x else: let y = x
which works fine for most identifiers. But certain built-ins like stdout
and stderr
makes the compiler crash.
Example
when stderr is static:
echo "whoops"
else:
echo "works"
Current Output
fatal.nim(53) sysFatal
Error: unhandled exception: index -1 not in 0 .. 0 [IndexDefect]
Expected Output
works
Possible Solution
Not really sure what a possible solution would be, but building a debug compiler gives a lot more output to work with.