Hi!
I tried defining a range as type and then used high() and low() to get the interval's upper and lower bounds. I found that high() and low() return a range type value while I would have expected the return value to be of the type of the underlying ordinal type for the range's bounds. Converting to result to int works (see below) but I am wondering:
$ nim secret
>>> type R = 1..10
>>> low(R)
1: R
>>> high(R)
10: R
>>> type(high(R))
R: typedesc[R]
>>> int(low(R))
1: int
I think it's the right thing to do, since high/low are used for example for enums:
type
MyEnum = enum
Small, Medium, Large
echo low(MyEnum)
echo high(MyEnum)
Also, range types are implicitly convertible to their parent ones, so it's not such a big deal:
Acknowledged, thank you for the reply! :D