You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because the method tables for convert are very long, this filter_gboxed.jl script is handy:
using Convert
isgboxed_method(m::Method) =_isgboxed(Base.unwrap_unionall(m.sig).parameters[2])
_isgboxed(::Type{Type{T}}) where T<:GBoxed=truefunction_isgboxed(t::Type)
p = Base.unwrap_unionall(t).parameters
length(p) !=1&&returnfalse_isgboxed(p[1])
end_isgboxed(TV::TypeVar) = TV.ub <:GBoxed_isgboxed(arg) =false
mt =methods(convert)
collect(Iterators.filter(isgboxed_method, mt))
As written, the output is
5-element Array{Any,1}:convert(::Type{Convert.GdkEvent}, evt::Ptr{Convert.GdkEvent}) in Convert at /tmp/Convert.jl:18convert(::Type{T}, unbox::Ptr{T}) where T<:Convert.GBoxedin Convert at /tmp/Convert.jl:14convert(::Type{Convert.GBoxed}, unbox::Ptr{Convert.GBoxed}) in Convert at /tmp/Convert.jl:11convert(::Type{Convert.GBoxed}, unbox::Ptr{T}) where T<:Convert.GBoxedin Convert at /tmp/Convert.jl:12convert(::Type{T}, unbox::Ptr{Convert.GBoxed}) where T<:Convert.GBoxedin Convert at /tmp/Convert.jl:13
However, if you change it to __precompile__(true) then I get
convert(::Type{Convert.GBoxed}, unbox::Ptr{Convert.GBoxed}) in Convert at /tmp/Convert.jl:11convert(::Type{T}, unbox::Ptr{T}) where T<:Convert.GBoxedin Convert at /tmp/Convert.jl:14convert(::Type{Convert.GdkEvent}, evt::Ptr{Convert.GdkEvent}) in Convert at /tmp/Convert.jl:18convert(::Type{Convert.GBoxed}, unbox::Ptr{T}) where T<:Convert.GBoxedin Convert at /tmp/Convert.jl:12convert(::Type{T}, unbox::Ptr{Convert.GBoxed}) where T<:Convert.GBoxedin Convert at /tmp/Convert.jl:13
The second method should come after the third.
The text was updated successfully, but these errors were encountered:
Noticed in JuliaGraphics/Gtk.jl#311. Here's a reasonably short repro:
Because the method tables for
convert
are very long, thisfilter_gboxed.jl
script is handy:As written, the output is
However, if you change it to
__precompile__(true)
then I getThe second method should come after the third.
The text was updated successfully, but these errors were encountered: