> Latest Nim is not that dumb for literals:
This is not new. NIm has been able to handle these implicit conversions since
pretty much forever (I checked 0.11.0 to be sure).
Where problems come into play are constants in complex types, such as ranges,
tuples, and arrays. For example, the following won't work:
var x: (int16, int16) = (1, 1)
Run
For arrays and sequences, there is a workaround by casting only the first
element:
var x: seq[int16] = @[int16 1, 2, 3, 4]
Run
For ranges (e.g. in for loops), it is generally sufficient to convert the lower
bound, but that's still not pretty:
for i in 0'i16..32767:
foo(i)
Run