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
?? refuses a view of an Option (xs[i] ?? 0 on a List[Option[i32]]): D22 says ?? is transparent to view origins #2524
fn main:
let v: List[Option[i32]] = [Some(8)]
print(f"{v[0] ?? 0}") # error: ?? operator requires an Option or Result with a single success payload
let e = v[0]
print(f"{e ?? 0}") # the same
v[0] is the element place (D27) and binds a view, &Option[i32]; ?? refuses the view. D22 §21.1 and the d22-Eric-Ruling say Option, Result, patterns, ?, ?? and the eliminators are transparent to view origins, so ?? on a &Option[i32] is a ?? on the Option it views, yielding the payload (a Copy i32 here; a view of it for an owning payload). Found writing the D103 element-site fixture (behav_d103_site_element.w reads the element with .unwrap() until this is fixed).
Fixed on main (b050a01, PR #2587, stack #2588): one commit with the fixture test/behavior/behav_2524_default_through_option_view.w, which failed before the fix and passes after; battery GREEN on the stack top 077d684 (669 s, pinned seed nightly-20261023-local-1).
Activity
`??` looks through a view of its carrier; MIR reads the carrier throu…
Six fixes from the issue backlog: #2545, #2524, #2334, #2325, #2443, #…
ehartford commentedon Oct 23, 2026
Fixed on main (b050a01, PR #2587, stack #2588): one commit with the fixture
test/behavior/behav_2524_default_through_option_view.w, which failed before the fix and passes after; battery GREEN on the stack top 077d684 (669 s, pinned seed nightly-20261023-local-1).