Type inference of arrays - weird error message
I'm not saying that this should work, but the error message is a bit weird...
fn a() -> int<8> {
let x = [5, 7];
x[0] + x[1]
}
error: Integer value does not fit in int<1>
┌─ testinput:3:14
│
3 │ x[0] + x[1]
│ ^ 1 does not fit in an int<1>
│
= note: int<1> fits integers in the range (-1, 0)
Compare with this that works:
fn a() -> int<8> {
let x = [5, 7];
x[0] + 3
}