summary refs log tree commit diff stats
path: root/tests/misc/mfield_defect.nim
blob: 53bfba40edcbc2a0a35c0d015d799007879abdb6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#[
ran from trunner
]#






# line 10
type Kind = enum k0, k1, k2, k3, k4

type Foo = object
  case kind: Kind
  of k0: f0: int
  of k1: f1: int
  of k2: f2: int
  of k3: f3: int
  of k4: f4: int

proc main()=
  var foo = Foo(kind: k3, f3: 3)
  let s1 = foo.f3
  doAssert s1 == 3
  let s2 = foo.f2

when defined case1:
  static: main()
when defined case2:
  main()