summary refs log tree commit diff stats
path: root/tests/lookups/tenumlocalsym.nim
blob: 575227c078cffe1b977e10e0948a8341dd50802a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
block:
  type Enum = enum a, b

  block:
    let a = b
    let x: Enum = a
    doAssert x == b
  
block:
  type
    Enum = enum
      a = 2
      b = 10

  iterator items2(): Enum =
    for a in [a, b]:
      yield a

  var s = newSeq[Enum]()
  for i in items2():
    s.add i
  doAssert s == @[a, b]