Skip to content

1.5: Surprising new pointer behaviour with adjoints and views #36402

Closed
@dlfivefifty

Description

@dlfivefifty

This seems wrong to me:

julia> A = randn(5,3);

julia> V = view(A',:,2:4)
3×3 view(::Adjoint{Float64,Array{Float64,2}}, :, 2:4) with eltype Float64:
 -0.6594    -0.124149   0.492452
  1.20338    0.224742  -0.0431509
 -0.425888   0.725104   0.976229

julia> Base.unsafe_load(pointer(V))
0.49245221105087544

I expected it to return the pointer to V[1,1], not V[1,end].

Related to #35929

@mbauman

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrays[a, r, r, a, y, s]bugIndicates an unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions