summary refs log tree commit diff stats
path: root/tests/objvariant/tadrdisc.nim
blob: 1afe7d04f73167fc369ac305c04b20cdb852427f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
discard """
  file: "tadrdisc.nim"
  line: 20
  errormsg: "type mismatch: got (TKind)"
"""
# Test that the address of a dicriminants cannot be taken

type
  TKind = enum ka, kb, kc
  TA = object
    case k: TKind
    of ka: x, y: int
    of kb: a, b: string
    of kc: c, d: float

proc setKind(k: var TKind) =
  k = kc

var a: TA
setKind(a.k)