Skip to content

Commit

Permalink
Merge pull request FluxML#469 from invenia/ed/hang-draw-and-quarter
Browse files Browse the repository at this point in the history
Stop type treason with show of the TrackedArray type
  • Loading branch information
MikeInnes committed Dec 19, 2018
1 parent c3ca56f commit 9d56382
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/tracker/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ TrackedArray(x::AbstractArray) = TrackedArray(Call(), x, zero(x))

Base.eltype(x::Type{<:TrackedArray{T}}) where T <: Real = TrackedReal{T}

Base.show(io::IO, ::Type{TrackedArray{T,N,A}}) where {T,N,A<:AbstractArray{T,N}} =
print(io, "TrackedArray{…,$A}")
Base.show(io::IO, t::Type{TrackedArray{T,N,A}}) where {T,N,A<:AbstractArray{T,N}} =
@isdefined(A) ?
print(io, "TrackedArray{…,$A}") :
invoke(show, Tuple{IO,DataType}, io, t)

function Base.summary(io::IO, x::TrackedArray)
print(io, "Tracked ")
Expand Down

0 comments on commit 9d56382

Please sign in to comment.