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
say(&o.unwrap_or(Vec.new())): MIR lowering fails — Vec.new() gets no expected type under & #1393
fn ov() -> Option[Vec[i32]]: None
fn say(t: &Vec[i32]): print(t.len())
fn main:
let o = ov()
say(&o.unwrap_or(Vec.new()))
Actual (installed v0.15.2.1, origin/main 8c859a7): error: code generation failed; WITH_MIR_AUDIT=1 shows [mir-lower-fail] kind=27 fn=main at the Vec.new() span. The same default bound first (let v = o.unwrap_or(Vec.new())) compiles. Same for &(r ?? Vec.new()).
Expected: 0. The join (spec §3.8, §10) fixes the default arm type to Vec[i32]; the & operand context must not erase it.
Activity
Sema: a join arm typed as a bare generic (`Vec.new()`) records the jo…
Sema: a join arm typed as a bare generic (`Vec.new()`) records the jo…
Sema: a join arm typed as a bare generic (`Vec.new()`) records the jo…
Sema: a join arm typed as a bare generic (`Vec.new()`) records the jo…
Sema: a join arm typed as a bare generic (`Vec.new()`) records the jo…