Skip to content

One-dimensional views assume their range index is 1-indexed #37199

@jishnub

Description

@jishnub

This happens if the range used to create the view does not span the entire axis of the parent array

julia> b = zeros(6, 2);

julia> r = Base.IdentityUnitRange(4:6);

julia> b[r, 2] .= 3
3-element view(::Array{Float64,2}, :, 2) with eltype Float64 with indices 4:6:
 3.0
 6.90395899974187e-310
 6.90395899973673e-310

julia> b
6×2 Array{Float64,2}:
 0.0  0.0
 0.0  0.0
 0.0  0.0
 0.0  0.0
 0.0  0.0
 0.0  0.0

Metadata

Metadata

Assignees

Labels

bugIndicates an unexpected problem or unintended behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions