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
projected intrinsic receiver lowering mutates temporaries instead of storage #78
Projected intrinsic receiver lowering does not preserve lvalue identity. When an intrinsic receiver is a projection rooted in a non-place expression, MIR materializes the base into a temporary and the mutation lands on that temporary instead of the underlying storage.
This issue now tracks only the projected-receiver MIR bug. Collection-specific follow-ups were split into separate issues.
Mutating through a projected receiver should update the underlying storage regardless of whether the receiver expression is written directly, grouped, aliased, or returned from a helper.
Actual
The mutation is applied to a temporary copy of the projected value, so the original storage is unchanged and the runtime assertions fail.
Root cause
In src/MirLower.w, lower_intrinsic_call lowers instance receivers via lower_expr(self_expr). For field access, lower_expr turns the field place into OK_COPY, and lower_expr_place materializes non-place bases into temporaries. For shapes like items.get(0).tags.push(...), the get(0) result becomes a temporary local and push mutates temp.tags instead of the vec element.
Closed by a1225df (Fix #78 bound Vec.get receiver alias lowering). Root cause was MIR lowering forcing let item = items.get(0) into an owning local copy instead of preserving the vec element place, so item.tags.push(...) mutated the copied Inner. Validation: make build, make selfcheck, make fixpoint, targeted issue64 repros, and make test now at 537 passed / 1 failed with only #77 remaining.
Activity
[-]receiver-shape lowering regresses projected mutations and borrowed collection methods[/-][+]projected intrinsic receiver lowering mutates temporaries instead of storage[/+]ehartford commentedon Apr 6, 2026
Split follow-ups out of this issue after investigation:
HashMap.removelowers to the raw presence flag instead ofOption[V]HashSetintrinsic lowering assumes HashMap-style shapes and breaks direct/borrowedcontainsandremoveThis issue now tracks only the projected-receiver MIR lvalue-preservation bug.
ehartford commentedon Apr 7, 2026
Closed by
a1225df(Fix #78 bound Vec.get receiver alias lowering). Root cause was MIR lowering forcinglet item = items.get(0)into an owning local copy instead of preserving the vec element place, soitem.tags.push(...)mutated the copiedInner. Validation:make build,make selfcheck,make fixpoint, targetedissue64repros, andmake testnow at537 passed / 1 failedwith only#77remaining.Fix #78 bound Vec.get receiver alias lowering