summary refs log tree commit diff stats
path: root/tests/proc/tproc.nim
Commit message (Collapse)AuthorAgeFilesLines
* Merge tests into a larger file (part 5 of ∞) (#9368)Miran2018-10-161-0/+31
* merge magics * merge metatype tests * merge method tests * merge objects tests * change `import future` to `import sugar` Nim in Action tests are left with `import future`, to ensure compatibility. * merge overload tests * merge proc tests * merge procvar tests * merge range tests * merge seq tests * merge sets tests * remove wrong assert from `tsets3` * fix `jsTests` * better fix
5ee'>2589d69ed ^
2f13d2772 ^
2589d69ed ^










1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
           
                                                                    
          
            










                                                                  
discard """
  errormsg: "type mismatch: got <int> but expected 'cshort = int16'"
  line: 12
  column: 27
  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