tnon_zero_discrim_err.nim 250 B

123456789101112131415
  1. discard """
  2. errormsg: "low(kind) must be 0 for discriminant"
  3. line: 7
  4. """
  5. type
  6. HoledObj = object
  7. case kind: int
  8. of 0: a: int
  9. else: discard
  10. let someInt = low(int)
  11. case someInt
  12. of 938: echo HoledObj(kind: someInt, a: 1)
  13. else: discard