Skip to content

Commit 29057e2

Browse files
authored
Merge pull request #241 from KristofferC/kc/show_type
stop overloading `show` on `Type`s
2 parents 871dea0 + 66a37f9 commit 29057e2

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/tangent.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ wrapper_name(::Type{<:ZeroBundle}) = "ZeroBundle"
304304
wrapper_name(::Type{<:DNEBundle}) = "DNEBundle"
305305
wrapper_name(::Type{<:AbstractZeroBundle}) = "AbstractZeroBundle"
306306

307+
#=
308+
# These methods cause too many invalidations to be feasible
307309
function Base.show(io::IO, T::Type{<:AbstractZeroBundle{N, B}}) where {N,B}
308310
print(io, wrapper_name(T))
309311
print(io, @isdefined(N) ? "{$N, " : "{N, ")
@@ -315,6 +317,7 @@ function Base.show(io::IO, T::Type{<:AbstractZeroBundle{N}}) where {N}
315317
print(io, wrapper_name(T))
316318
@isdefined(N) && print(io, "{$N}")
317319
end
320+
=#
318321

319322
function Base.show(io::IO, t::AbstractZeroBundle{N}) where N
320323
print(io, wrapper_name(typeof(t)))

test/tangent.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ using Test
1616

1717
@testset "Display" begin
1818
@test repr(ZeroBundle{1}(2.0)) == "ZeroBundle{1}(2.0)"
19+
#=
20+
Overloading of Type printing is disabled for now
1921
@test repr(DNEBundle{1}(getfield)) == "DNEBundle{1}(getfield)"
2022
2123
@test repr(ZeroBundle{1}) == "ZeroBundle{1}"
@@ -24,6 +26,7 @@ using Test
2426
@test repr((ZeroBundle{N, Float64} where N).body) == "ZeroBundle{N, Float64}"
2527
2628
@test repr(typeof(DNEBundle{1}(getfield))) == "DNEBundle{1, typeof(getfield)}"
29+
=#
2730
end
2831
end
2932

0 commit comments

Comments
 (0)