Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unaliascopy(::SubArray) with indices of Array{<:CartesianIndex} #47779

Merged
merged 2 commits into from
Dec 11, 2023

Conversation

N5N3
Copy link
Member

@N5N3 N5N3 commented Dec 2, 2022

This PR fixes the bug caused by the trimming trick.
Base.index_lengths is not a proper tool to calculate the trimmed shape as indices might consume more than 1 dim.
And we can avoid the unneeded "repeat" when we meet Array{CartesianIndex{0}}

Test added.
Close #47644.

@N5N3 N5N3 added domain:arrays [a, r, r, a, y, s] kind:bugfix This change fixes an existing bug labels Dec 2, 2022
@jishnub jishnub requested a review from vtjnash December 11, 2023 05:49
base/subarray.jl Outdated Show resolved Hide resolved
@N5N3 N5N3 merged commit e39e77f into JuliaLang:master Dec 11, 2023
7 checks passed
@N5N3 N5N3 deleted the fix-unaliascopy branch December 11, 2023 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:arrays [a, r, r, a, y, s] kind:bugfix This change fixes an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Base.unaliascopy for SubArray is broken for indices with AbstractArray{<:CartesianIndex}
2 participants