Skip to content

Fix aliasing detection for LazyRows - #374

Open
aplavin wants to merge 2 commits into
JuliaArrays:masterfrom
aplavin:lazyrows-dataids
Open

aplavin wants to merge 2 commits into
JuliaArrays:masterfrom
aplavin:lazyrows-dataids

Conversation

@aplavin

@aplavin aplavin commented Nov 12, 2026

Copy link
Copy Markdown
Member

Bugfix:

using StructArrays
s = StructArray(a=[1, 2, 3])
s.a .= (r -> r.a).(view(LazyRows(s), 3:-1:1))
s.a
# origin/master:     [3, 2, 3]   ← wrong
# lazyrows-dataids:  [3, 2, 1]

Define dataids and unaliascopy for LazyRows, so broadcasting from LazyRows into one of its own columns no longer gives wrong results.
Comment thread src/lazy.jl Resolved
Comment thread src/lazy.jl Resolved
Base's fallback uses copy, which changes the type for components such as views, and errors during broadcast unaliasing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants