Skip to content

Commit

Permalink
fix JuliaLang#17338, broken showing of SimpleVector (JuliaLang#17339)
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson authored and mfasi committed Sep 5, 2016
1 parent 8c718ef commit f83817a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions base/essentials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ done(v::SimpleVector,i) = (i > v.length)
isempty(v::SimpleVector) = (v.length == 0)
indices(v::SimpleVector) = (OneTo(length(v)),)
linearindices(v::SimpleVector) = indices(v, 1)
indices(v::SimpleVector, d) = d <= 1 ? indices(v)[d] : OneTo(1)

function ==(v1::SimpleVector, v2::SimpleVector)
length(v1)==length(v2) || return false
Expand Down
3 changes: 3 additions & 0 deletions test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -506,3 +506,6 @@ let io = IOBuffer()
dump(io, :(x = 1))
@test takebuf_string(io)[end] == '\n'
end

# issue #17338
@test repr(Core.svec(1,2)) == "svec(1,2)"

0 comments on commit f83817a

Please sign in to comment.