diff --git a/base/show.jl b/base/show.jl index e34a9290fbf7f..d94e4f17825db 100644 --- a/base/show.jl +++ b/base/show.jl @@ -1835,11 +1835,11 @@ end ## `summary` for AbstractArrays # sizes such as 0-dimensional, 4-dimensional, 2x3 -dims2string(d::Dims) = isempty(d) ? "0-dimensional" : - length(d) == 1 ? "$(d[1])-element" : - join(map(string,d), '×') +dims2string(d) = isempty(d) ? "0-dimensional" : + length(d) == 1 ? "$(d[1])-element" : + join(map(string,d), '×') -inds2string(inds::Indices) = join(map(string,inds), '×') +inds2string(inds) = join(map(string,inds), '×') # anything array-like gets summarized e.g. 10-element Array{Int64,1} summary(io::IO, a::AbstractArray) = summary(io, a, axes(a)) diff --git a/test/show.jl b/test/show.jl index d849901deade5..546c1eb94fdb6 100644 --- a/test/show.jl +++ b/test/show.jl @@ -1189,3 +1189,10 @@ end @test repr("text/plain", context=:compact=>true) == "\"text/plain\"" @test repr(MIME("text/plain"), context=:compact=>true) == "MIME type text/plain" end + +@testset "#26799 BigInt summary" begin + @test Base.dims2string(tuple(BigInt(10))) == "10-element" + @test Base.inds2string(tuple(BigInt(10))) == "10" + @test summary(BigInt(1):BigInt(10)) == "10-element UnitRange{BigInt}" + @test summary(Base.OneTo(BigInt(10))) == "10-element Base.OneTo{BigInt}" +end