summary refs log blame commit diff stats
path: root/tests/objvariant/tadrdisc.nim
blob: 5e4e39a440b21685fad877131e3bd5973b9fda45 (plain) (tree)
1
2
3
4
5
6
           
                                        

                      
   
                                                          







                         
 

                            
 

            
discard """
  errormsg: "type mismatch: got <TKind>"
  file: "tadrdisc.nim"
  line: 20
"""
# Test that the address of a discriminants 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)