This commit is contained in:
Yuriy Glukhov 2018-01-25 06:26:40 +03:00 • committed by Andreas Rumpf
commit 0b9c1da1c0
2 changed files with 48 additions and 42 deletions

View file

@ -35,7 +35,7 @@ proc isUndefined[T](x: T): bool {.inline.} = {.emit: "`result` = `x` === undefin
proc reprEnum(e: int, typ: PNimType): string {.compilerRtl.} = proc reprEnum(e: int, typ: PNimType): string {.compilerRtl.} =
if not typ.node.sons[e].isUndefined: if not typ.node.sons[e].isUndefined:
result = $typ.node.sons[e].name result = makeNimstrLit(typ.node.sons[e].name)
else: else:
result = $e & " (invalid data!)" result = $e & " (invalid data!)"

View file

@ -77,6 +77,12 @@ block enums:
doAssert(repr(heB) == "heB") doAssert(repr(heB) == "heB")
doAssert(repr(heC) == "heC") 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: block chars:
let let
a = 'a' a = 'a'