tadrdisc.nim 344 B

123456789101112131415161718192021
  1. discard """
  2. file: "tadrdisc.nim"
  3. line: 20
  4. errormsg: "type mismatch: got <TKind>"
  5. """
  6. # Test that the address of a dicriminants cannot be taken
  7. type
  8. TKind = enum ka, kb, kc
  9. TA = object
  10. case k: TKind
  11. of ka: x, y: int
  12. of kb: a, b: string
  13. of kc: c, d: float
  14. proc setKind(k: var TKind) =
  15. k = kc
  16. var a: TA
  17. setKind(a.k)