mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-06 13:07:48 +00:00
bugfix: reprEnum
This commit is contained in:
@@ -50,6 +50,8 @@ proc reprChar(x: char): string {.compilerRtl.} =
|
||||
add result, "\'"
|
||||
|
||||
proc reprEnum(e: int, typ: PNimType): string {.compilerRtl.} =
|
||||
# we read an 'int' but this may have been too large, so mask the other bits:
|
||||
let e = e and (1 shl (typ.size*8)-1)
|
||||
if ntfEnumHole notin typ.flags:
|
||||
if e <% typ.node.len:
|
||||
return $typ.node.sons[e].name
|
||||
|
||||
Reference in New Issue
Block a user