JuliaLang / IJulia.jl

Julia kernel for Jupyter
MIT License
2.78k stars 409 forks source link

cannot display `body` field of `UnionAll` type in IJulia #1098

Open matthias314 opened 9 months ago

matthias314 commented 9 months ago

Julia (1.9.4, 1.10.0-rc1, master):

julia> Pair{Char}.body
Pair{Char, B}

julia> Pair.body
Pair{A}

IJulia (v1.24.2):

In [1]: Pair{Char}.body
Out[1]: Pair{Char, B}

In [2]: Pair.body
MethodError: Cannot `convert` an object of type Type{Pair{A}} to an object of type DataType

Closest candidates are:
  convert(::Type{T}, ::T) where T
   @ Base Base.jl:96

Stacktrace:
 [1] Base.Fix2(f::typeof(isequal), x::Type)
   @ Base ./operators.jl:1139
 [2] isequal
   @ Base ./operators.jl:1154 [inlined]
 [3] undisplay(x::Type)
   @ IJulia /usr/local/julia/packages/IJulia/Vo51o/src/display.jl:131
 [4] execute_request(socket::ZMQ.Socket, msg::IJulia.Msg)
   @ IJulia /usr/local/julia/packages/IJulia/Vo51o/src/execute_request.jl:107
 [5] #invokelatest#2
   @ ./essentials.jl:955 [inlined]
 [6] invokelatest
   @ ./essentials.jl:952 [inlined]
 [7] eventloop(socket::ZMQ.Socket)
   @ IJulia /usr/local/julia/packages/IJulia/Vo51o/src/eventloop.jl:8
 [8] (::IJulia.var"#15#18")()
   @ IJulia /usr/local/julia/packages/IJulia/Vo51o/src/eventloop.jl:38

I don't know if displaying such internal fields is considered fair game or not.