tsubrange.nim 197 B

123456789101112131415161718192021
  1. discard """
  2. errormsg: "cannot convert 60 to TRange"
  3. line: 20
  4. """
  5. type
  6. TRange = range[0..40]
  7. proc p(r: TRange) =
  8. discard
  9. var
  10. r: TRange
  11. y = 50
  12. r = y
  13. p y
  14. const
  15. myConst: TRange = 60