What can be done to find what makes the Nim compiler crash? I've been translating a Python program to Nim and the compiler crashes with the error
fatal.nim(39) sysFatal
Error: unhandled exception: 'sym' is not accessible using discriminant 'kind' of type 'TNode' [FieldError]
I've built a debugging version of nim and I get the same stack trace as reported in this issue. I've tried to reduce the scope of the compilation to limited sections of the source without being able to find where the problem lies, probably a syntax error like in the issue but I can't spot it.
Here is the code https://play.nim-lang.org/#ix=246h
Any hint welcome.
I just saw that the code in the playground is not the last version of the source that is on another PC that I can't access presently, where there are syntax errors like at line 91
# The set of constraints which are currently unsatisfied.
unsatisfied = HashSet[T].toHashSet(keys(choices))
and probably other I already corrected. But the bug in the Nim compiler is still present. I'll try to update the source with the latest version tomorrow.
My question is both where is the problem with the compiler in that source and more importantly, how to find it when such situation occurs.
What I do is to compile using --verbosity:3
In that particular case, it did no difference, even with the debug compiler...