Feature: explicit string representation for enum fields
This commit is contained in:
parent
d48ab37495
commit
1a8c6fb49f
9 changed files with 94 additions and 8 deletions
16
tests/accept/run/tenumhole.nim
Normal file
16
tests/accept/run/tenumhole.nim
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
const
|
||||
strValB = "my value B"
|
||||
|
||||
type
|
||||
TMyEnum = enum
|
||||
valueA = (1, "my value A"),
|
||||
valueB = strValB & "conc",
|
||||
valueC,
|
||||
valueD = (4, "abc")
|
||||
|
||||
# trick the optimizer with a variable:
|
||||
var x = valueD
|
||||
echo valueA, ord(valueA), valueB, ord(valueB), valueC, valueD, ord(valueD), x
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue