LeuGim: a side note: it's not an implicit conversion, with "var x: int8" Nim
treats your "3" literal as "int8" type
Regarding assignment, it doesn't have to depend on types being
indistinguishable. E.g.:
proc p(x: int) = echo "int"
proc p(x: int8) = echo "int8"
var x: int8
x=3 # implicit conversion
p x # int8
p 3 # int
overloading works here, while allowing literal's
You can try to search forum for if there were previous discussions... Just
> the situation when you can declare something that you cannot later call
seems to be not intended.
I can definitely report this on Github, but before doing this I'd like to
better understand this inconsistency.
It seems that for array initialization to work as expected, array types that
differ only in index boundaries should be treated as equal. Otherwise this:
var b: array[-1
Report it as a bug on Github, if it's not there already, it's an old issue.
Two arrays of the same size and element type but with different index
boundaries seem to be distinct types for the purpose of (polymorphic) proc
definitions, so this compiles:
proc p(a: array[10, int]) = discard
proc p(a: array[-1 .. 8, int]) = discard
but they seem to