summary refs log tree commit diff stats
path: root/tests/objvariant/tconstobjvariant.nim
blob: 45a64770781848a3a7556425987f93adbca48819 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# This is a sample code, the first echo statement prints out the error
type
  A = object
    case w: uint8
    of 1:
      n: int
    else:
      other: string

const
  a = A(w: 1, n: 5)

proc foo =

  let c = [a]
  doAssert c[0].n == 5

foo()