a constant must indeed be a constant
This is not enforced by the compiler. It causes troubles to the back-end.
sort of a duplicate of #49.
Should we not just evaluate the constant? I suppose that gets hard with C in the mix
We don't evaluate them. We instead substitute the variable with the RHS of =. So when they're mistakenly not constants, we don't handle it properly in the code generator.
I also think this could be potentially problematic if we had a proper refinement type system.
a : Int
a = 5
should probably be compiled to
a : {a : Int | a = 5}
a = _
If that's not a constant, I don't know how much sense it makes (esp. if we want make the SMT solver decidable)