tshow_asgn.nim 336 B

12345678910111213141516
  1. discard """
  2. errormsg: "type mismatch: got <int> but expected 'cshort = int16'"
  3. line: 12
  4. column: 27
  5. file: "tshow_asgn.nim"
  6. """
  7. # bug #5430
  8. proc random*[T](x: Slice[T]): T =
  9. ## For a slice `a .. b` returns a value in the range `a .. b-1`.
  10. result = int(x.b - x.a) + x.a
  11. let slice = 10.cshort..15.cshort
  12. discard slice.random