parent
d5b4936332
commit
0b9c1da1c0
2 changed files with 48 additions and 42 deletions
|
|
@ -35,7 +35,7 @@ proc isUndefined[T](x: T): bool {.inline.} = {.emit: "`result` = `x` === undefin
|
|||
|
||||
proc reprEnum(e: int, typ: PNimType): string {.compilerRtl.} =
|
||||
if not typ.node.sons[e].isUndefined:
|
||||
result = $typ.node.sons[e].name
|
||||
result = makeNimstrLit(typ.node.sons[e].name)
|
||||
else:
|
||||
result = $e & " (invalid data!)"
|
||||
|
||||
|
|
|
|||
|
|
@ -77,6 +77,12 @@ block enums:
|
|||
doAssert(repr(heB) == "heB")
|
||||
doAssert(repr(heC) == "heC")
|
||||
|
||||
block emums_and_unicode: #6741
|
||||
type K = enum Kanji = "漢字"
|
||||
let kanji = Kanji
|
||||
doAssert(kanji == Kanji, "Enum values are not equal")
|
||||
doAssert($kanji == $Kanji, "Enum string values are not equal")
|
||||
|
||||
block chars:
|
||||
let
|
||||
a = 'a'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue