summary refs log tree commit diff stats
path: root/tests/range/tn8vsint16.nim
blob: bf4f78e3bae3dbf3bf98d49ee4a5df533c78cdd9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
discard """
  output: '''-9'''
"""

type
  n32 = range[0..high(int)]
  n8* = range[0'i8..high(int8)]

proc `+`*(a: n32, b: n32{nkIntLit}): n32 = discard

proc `-`*(a: n8, b: n8): n8 = n8(system.`-`(a, b))

var x, y: n8
var z: int16

# ensure this doesn't call our '-' but system.`-` for int16:
echo z - n8(9)