newLit works on enum (#9662)
* newLit works on enum * remove debugging echo
This commit is contained in:
parent
130c218ff9
commit
573d02760e
2 changed files with 30 additions and 0 deletions
|
|
@ -147,3 +147,23 @@ block:
|
|||
# x needs to be of type seq[string]
|
||||
var x = test_newLit_empty_seq_string
|
||||
x.add("xyz")
|
||||
|
||||
type
|
||||
MyEnum = enum
|
||||
meA
|
||||
meB
|
||||
|
||||
macro test_newLit_Enum: untyped =
|
||||
result = newLit(meA)
|
||||
|
||||
block:
|
||||
let tmp: MyEnum = meA
|
||||
doAssert tmp == test_newLit_Enum
|
||||
|
||||
macro test_newLit_set: untyped =
|
||||
let myset = {MyEnum.low .. MyEnum.high}
|
||||
result = newLit(myset)
|
||||
|
||||
block:
|
||||
let tmp: set[MyEnum] = {MyEnum.low .. MyEnum.high}
|
||||
doAssert tmp == test_newLit_set
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue