Skip to content

Commit 00de421

Browse files
authored
fix #17338, broken showing of SimpleVector (#17339)
1 parent c65e5fd commit 00de421

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

base/essentials.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ done(v::SimpleVector,i) = (i > v.length)
173173
isempty(v::SimpleVector) = (v.length == 0)
174174
indices(v::SimpleVector) = (OneTo(length(v)),)
175175
linearindices(v::SimpleVector) = indices(v, 1)
176+
indices(v::SimpleVector, d) = d <= 1 ? indices(v)[d] : OneTo(1)
176177

177178
function ==(v1::SimpleVector, v2::SimpleVector)
178179
length(v1)==length(v2) || return false

test/show.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,3 +506,6 @@ let io = IOBuffer()
506506
dump(io, :(x = 1))
507507
@test takebuf_string(io)[end] == '\n'
508508
end
509+
510+
# issue #17338
511+
@test repr(Core.svec(1,2)) == "svec(1,2)"

0 commit comments

Comments
 (0)