From ea3437897ef879938ce17dd3f7fa5f07b1dea6ab Mon Sep 17 00:00:00 2001 From: Andreas Noack Date: Mon, 15 Jun 2020 06:22:46 +0200 Subject: [PATCH] Delete show(::IO, ::Type) methods. Closes #321 (#322) --- src/display.jl | 7 ------- test/runtests.jl | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/display.jl b/src/display.jl index b7d5ccac..c906d16a 100644 --- a/src/display.jl +++ b/src/display.jl @@ -77,13 +77,6 @@ function show(io::IO, mime::MIME"text/plain", x::Quantity) end end -function show(io::IO, x::Type{T}) where T<:Quantity - invoke(show, Tuple{IO, typeof(x)}, IOContext(io, :showoperators=>true), x) -end -function show(io::IO, x::Type{T}) where T<:Unitlike - invoke(show, Tuple{IO, typeof(x)}, IOContext(io, :showoperators=>true), x) -end - function show(io::IO, r::Union{StepRange{T},StepRangeLen{T}}) where T<:Quantity a,s,b = first(r), step(r), last(r) U = unit(a) diff --git a/test/runtests.jl b/test/runtests.jl index 13f94dd5..e0ff0b80 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1235,9 +1235,9 @@ end @testset "Display" begin withenv("UNITFUL_FANCY_EXPONENTS" => false) do @test string(typeof(1.0m/s)) == - "Quantity{Float64,𝐋*𝐓^-1,FreeUnits{(m, s^-1),𝐋*𝐓^-1,nothing}}" + "Quantity{Float64,𝐋 𝐓^-1,FreeUnits{(m, s^-1),𝐋 𝐓^-1,nothing}}" @test string(typeof(m/s)) == - "FreeUnits{(m, s^-1),𝐋*𝐓^-1,nothing}" + "FreeUnits{(m, s^-1),𝐋 𝐓^-1,nothing}" @test string(dimension(1u"m/s")) == "𝐋 𝐓^-1" @test string(NoDims) == "NoDims" end