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

Error during ReinterpretArray-to-Array copy: isassigned(::ReinterpretArray) is missing #52925

Closed
maleadt opened this issue Jan 16, 2024 · 1 comment · Fixed by #53663
Closed
Labels
arrays [a, r, r, a, y, s] regression Regression in behavior compared to a previous version
Milestone

Comments

@maleadt
Copy link
Member

maleadt commented Jan 16, 2024

MWE:

julia> Array(reinterpret(reshape, Float32, ComplexF32[1.0f0+2.0f0*im]))
ERROR: MethodError: no method matching isassigned(::Base.ReinterpretArray{Float32, 2, ComplexF32, Vector{ComplexF32}, true}, ::Base.SCartesianIndex2{2})

Closest candidates are:
  isassigned(::AbstractArray, ::CartesianIndex)
   @ Base multidimensional.jl:1568
  isassigned(::AbstractArray, ::Union{Integer, CartesianIndex}...)
   @ Base multidimensional.jl:1569

Stacktrace:
 [1] copyto_unaliased!
   @ ./abstractarray.jl:1089 [inlined]
 [2] copyto!(dest::Matrix{Float32}, src::Base.ReinterpretArray{Float32, 2, ComplexF32, Vector{ComplexF32}, true})
   @ Base ./abstractarray.jl:1058
 [3] copyto_axcheck!
   @ ./abstractarray.jl:1188 [inlined]
 [4] Array
   @ ./array.jl:612 [inlined]
 [5] Array(A::Base.ReinterpretArray{Float32, 2, ComplexF32, Vector{ComplexF32}, true})
   @ Core ./boot.jl:601
 [6] top-level scope
   @ REPL[8]:1

Bisected to #51760; cc @vtjnash.

@maleadt maleadt added the regression Regression in behavior compared to a previous version label Jan 16, 2024
@maleadt maleadt added this to the 1.11 milestone Jan 16, 2024
@maleadt maleadt added the arrays [a, r, r, a, y, s] label Jan 16, 2024
@timholy
Copy link
Member

timholy commented Jan 25, 2024

Also noticed in the ImageCore tests with isassigned(::ReinterpretArray, ::Base.SCartesianIndex2{2}). xref https://github.com/JuliaImages/ImageCore.jl/actions/runs/7655272073/job/20860957804?pr=199

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrays [a, r, r, a, y, s] regression Regression in behavior compared to a previous version
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants