Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/ccgexprs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2070,7 +2070,7 @@ proc genDispose(p: BProc; n: PNode) =

proc genEnumToStr(p: BProc, e: PNode, d: var TLoc) =
const ToStringProcSlot = -4
let t = e[1].typ.skipTypes(abstractInst)
let t = e[1].typ.skipTypes(abstractInst+{tyRange})
var toStrProc: PSym = nil
for idx, p in items(t.methods):
if idx == ToStringProcSlot:
Expand Down
12 changes: 12 additions & 0 deletions tests/enum/tenum_no_rtti.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
discard """
output: '''A
B'''
cmd: '''nim c --gc:arc $file'''
"""
type
Enum = enum A, B, C
EnumRange = range[A .. B]
proc test_a(x: Enum): string = $x
proc test_b(x: EnumRange): string = $x
echo test_a(A)
echo test_b(B)