june icon indicating copy to clipboard operation
june copied to clipboard

Values of deduced types not allowed in array index

Open lefticus opened this issue 11 months ago • 0 comments

fun get_val() -> i64 {
  return 1;
}

// both options get the same error:

let val = get_val()
// or 
let val = 42

let data = raw[1,2,3]
data[val]
────┬─ /home/jason/june/examples/june_hello_world/main/main.june:47:21
 46 │ 
 47 │       self.contents[index] = value
    │                     ╍╍╍╍╍ error: expected integer type for indexing
 48 │     }
────┴─

lefticus avatar Mar 10 '24 00:03 lefticus