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
ICE: slicing a list element in place (parts[0][..n]) — "slice base does not resolve to a concrete place type" #2578
Four lines, on the pinned seed (nightly-20261020-local-3) and on main 285c495's installed compiler alike:
fn main:
let parts: List[str] = ["ab:cd"]
let colon = parts[0].find(":")
print(parts[0][..colon])
error: internal compiler error: invalid MIR before codegen (a bug in the With compiler, not in this program): slice base does not resolve to a concrete place type in `main`
--> slice_elem.w:4:11
parts[0] is a &str element place (D27); a slice of it is a slice of a place like any other. Binding it first (let segment: str = parts[0]; segment[..colon]) compiles. Found writing ci_generic_selection_selected (CImport.w), whose segment slicing now goes through a binding; the route is --dump-mir of main (the slice statement's base operand) then the slice lowering in MirLower.
Fixed in #2580 (c7fa606): the lowering read through a reference whenever Sema's type of the base expression was a reference; an element place is typed as a view but its MIR place is the element. The place's own type decides now (MirLower.place_holds_reference). Fixture behav_2578 covers a list element, an array element, a slice element, a nested list, rest(), first() and a for loop.
Activity
Seven compiler fixes: literals at distinct demands (D153), element-pl…
ehartford commentedon Oct 23, 2026
Fixed in #2580 (c7fa606): the lowering read through a reference whenever Sema's type of the base expression was a reference; an element place is typed as a view but its MIR place is the element. The place's own type decides now (MirLower.place_holds_reference). Fixture behav_2578 covers a list element, an array element, a slice element, a nested list, rest(), first() and a for loop.