tadrdisc.nim 345 B

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