nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.43k stars 1.47k forks source link

converter doesn't work for case statement branches with the `..` operator #11422

Open sealmove opened 5 years ago

sealmove commented 5 years ago

The following code crushes the compiler

converter toInt(c: char): int = int(c)
var c: int = 5
case c
of 'a' .. 'c': discard
else: discard
bug.nim(5, 4) Error: internal error: genLiteral(nkHiddenCallConv)
No stack traceback available
To create a stacktrace, rerun compilation with ./koch temp c <file>
kraptor commented 4 years ago

related to #8984