mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 18:02:05 +00:00
16 lines
336 B
Nim
16 lines
336 B
Nim
discard """
|
|
errormsg: "type mismatch: got (int) but expected 'cshort = int16'"
|
|
line: 12
|
|
column: 10
|
|
file: "tshow_asgn.nim"
|
|
"""
|
|
|
|
# bug #5430
|
|
|
|
proc random*[T](x: Slice[T]): T =
|
|
## For a slice `a .. b` returns a value in the range `a .. b-1`.
|
|
result = int(x.b - x.a) + x.a
|
|
|
|
let slice = 10.cshort..15.cshort
|
|
discard slice.random
|