tenumlocalsym.nim 300 B

1234567891011121314151617181920212223
  1. block:
  2. type Enum = enum a, b
  3. block:
  4. let a = b
  5. let x: Enum = a
  6. doAssert x == b
  7. block:
  8. type
  9. Enum = enum
  10. a = 2
  11. b = 10
  12. iterator items2(): Enum =
  13. for a in [a, b]:
  14. yield a
  15. var s = newSeq[Enum]()
  16. for i in items2():
  17. s.add i
  18. doAssert s == @[a, b]