Or you can specify the type for (1, 1):
let x: 1..2 = 1
let expected: (range[1..2]) = (1)
let expected2: (range[1..2], int) = (1, 1)
doAssert x == 1
doAssert (x) == expected
doAssert (x, 1) == expected2
echo typeof(expected) # range 1..2(int)
echo typeof(expected2) # (range 1..2(int), int)
Run
- How to properly compare a tuple mixed ranges and int with a tup... Dabod
- How to properly compare a tuple mixed ranges and int with ... choltreppe
- How to properly compare a tuple mixed ranges and int w... janAkali
