diff --git a/base/essentials.jl b/base/essentials.jl index 2f7ecbeff7645..5756a4571c81b 100644 --- a/base/essentials.jl +++ b/base/essentials.jl @@ -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 diff --git a/test/show.jl b/test/show.jl index b8e9abe1a7435..ce2dab19e4d38 100644 --- a/test/show.jl +++ b/test/show.jl @@ -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)"