Skip to content

Commit

Permalink
Fix typo in range display (#51832)
Browse files Browse the repository at this point in the history
Thanks ScottPJones for finding this.

Co-authored-by: Lilith Hafner <[email protected]>
  • Loading branch information
LilithHafner and Lilith Hafner authored Oct 24, 2023
1 parent abd00d0 commit b197197
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/range.jl
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ function show(io::IO, r::LinRange{T}) where {T}
print(io, "LinRange{")
show(io, T)
print(io, "}(")
ioc = IOContext(io, :typeinto=>T)
ioc = IOContext(io, :typeinfo=>T)
show(ioc, first(r))
print(io, ", ")
show(ioc, last(r))
Expand Down
2 changes: 2 additions & 0 deletions test/ranges.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1286,6 +1286,8 @@ end

@test sprint(show, UnitRange(1, 2)) == "1:2"
@test sprint(show, StepRange(1, 2, 5)) == "1:2:5"

@test sprint(show, LinRange{Float32}(1.5, 2.5, 10)) == "LinRange{Float32}(1.5, 2.5, 10)"
end

@testset "Issue 11049, and related" begin
Expand Down

0 comments on commit b197197

Please sign in to comment.