You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Vec range slice v[..] as a call argument lowers to a Unit operand (invalid MIR before codegen) #1632
Found while writing the D64 buffer-pairing fixtures (test/behavior/behav_c_facade_buffer_input.w).
Repro:
fn take(b: []u8) -> i32: b.len() as i32
fn main:
var v: Vec[u8] = Vec.new()
v.push(1)
print(take(v[..]))
Actual: error: invalid MIR before codegen: call argument 0 is Unit but the callee parameter is not.
Expected: the same []u8 view that take(v) (the #604 coercion) and arr[..] on an array produce (spec §4.8a: "slice of entire array").
Workaround used in the fixture: pass v and let the call-site coercion slice it.
Activity
Paper cuts: Vec ranges as []T views, let-else return inference, usize…