Skip to content

Commit d8275e9

Browse files
authored
Overload copy for ReshapedArray (#236)
1 parent 81070e5 commit d8275e9

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "InfiniteArrays"
22
uuid = "4858937d-0d70-526a-a4dd-2d5cb5dd786c"
3-
version = "0.15.11"
3+
version = "0.15.12"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"

src/reshapedarray.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ parentindices(A::ReshapedArray) = map(oneto, size(parent(A)))
1818

1919
unaliascopy(A::ReshapedArray) = typeof(A)(unaliascopy(A.parent), A.dims, A.mi)
2020
dataids(A::ReshapedArray) = dataids(A.parent)
21+
copy(A::ReshapedArray) = typeof(A)(copy(A.parent), A.dims, A.mi)
2122

2223
@inline function getindex(A::ReshapedArray{T,N}, indices::Vararg{Integer,N}) where {T,N}
2324
@boundscheck checkbounds(A, indices...)

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ end
10751075
@test a[1:7] == [1, 2, 2, 1, 2, 2, 1]
10761076
@test permutedims(permutedims(1:∞)) 1:
10771077
@test parentindices(a) (oneto(3),oneto(∞))
1078-
@test Base.unaliascopy(a) a
1078+
@test Base.unaliascopy(a) copy(a) a
10791079
@test Base.dataids(a) == Base.dataids(parent(a))
10801080
@test a[Base.ReshapedIndex(5)] == a[5]
10811081

0 commit comments

Comments
 (0)