tfloatrangeobj.nim 278 B

123456789101112131415
  1. discard """
  2. output: '''(kind: 2.0, twoStr: "TWO STR")
  3. (kind: 1.0)
  4. '''
  5. disabled: "true"
  6. """
  7. type
  8. FloatRange = range[1.0..3.0]
  9. VariantObj = object
  10. case kind: FloatRange
  11. of 2.0: twoStr: string
  12. echo VariantObj(kind: 2.0, twoStr: "TWO STR")
  13. echo VariantObj(kind: 1.0)