Debugging ::Any types in Cthulhu's descend

I’m trying to understand how to best interpret @descend from Cthulhu.jl in certain cases. Consider:

julia> using DataStructures, Cthulhu

julia> d = DefaultDict(-1, Dict(1 => 2));

julia> @descend delete!(d, 1)
delete!(a::DefaultDict, args...) @ DataStructures C:\Users\User\.julia\packages\DataStructures\59MD0\src\delegate.jl:37
37 ($funcname)(a::DefaultDict{Int64, Int64, Int64}::($typename), args::Tuple{Int64}...)::DefaultDict{Int64, Int64, Int64} =
38                        (($funcname)(a.$fieldname, args...); a)
Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark.
Toggles: [w]arn, [h]ide type-stable statements, [t]ype annotations, [s]yntax highlight for Source/LLVM/Native.
Show: [S]ource code, [A]ST, [T]yped code, [L]LVM IR, [N]ative code
Actions: [E]dit source code, [R]evise and redisplay
 • %2 = < constprop > getproperty(::DefaultDict{Int64, Int64, Int64},::Core.Const(:d))::DataStructures.DefaultDictBase{Int64, Int64, Int64, Dict{Int64, Int64}}
   %4 = delete!(::DataStructures.DefaultDictBase{Int64, Int64, Int64, Dict{Int64, Int64}},::Int64)::Any
   ↩

I see an Any at the end, so I descend into it, and eventually find that the first Any is here:

_delete!(h::Dict{K, V}, index) where {K, V} @ Base dict.jl:631
631 function (_delete!(h::Dict{Int64, Int64}::Dict{K,V}, index::Int64) where {K,V})::Dict{Int64, Int64}
632     @inbounds h::Dict{Int64, Int64}.slots::Vector{UInt8}[index::Int64] = 0x7f
633     @inbounds _unsetindex!(h::Dict{Int64, Int64}.keys::Vector{Int64}, index::Int64)::Vector{Int64}
634     @inbounds _unsetindex!(h::Dict{Int64, Int64}.vals::Vector{Int64}, index::Int64)::Vector{Int64}
635     (h::Dict{Int64, Int64}.ndel::Int64 += 1)::Int64
636     (h::Dict{Int64, Int64}.count::Int64 -= 1)::Int64
637     (h::Dict{Int64, Int64}.age::UInt64 += 1)::UInt64
638     return h::Dict{Int64, Int64}
639 end
Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark.
Toggles: [w]arn, [h]ide type-stable statements, [t]ype annotations, [s]yntax highlight for Source/LLVM/Native.
Show: [S]ource code, [A]ST, [T]yped code, [L]LVM IR, [N]ative code
Actions: [E]dit source code, [R]evise and redisplay
   h::Dict{Int64, Int64}.slots
 • %4 = setindex!(::Vector{UInt8},::UInt8,::Int64)::Any
   h::Dict{Int64, Int64}.keys
   _unsetindex!(h::Dict{Int64, Int64}.keys::Vector{Int64}, index::Int64)
   h::Dict{Int64, Int64}.vals
   _unsetindex!(h::Dict{Int64, Int64}.vals::Vector{Int64}, index::Int64)
   h::Dict{Int64, Int64}.ndel
   h::Dict{Int64, Int64}.ndel::Int64 += 1
   %20 = < constprop > setproperty!(::Dict{Int64, Int64},::Core.Const(:ndel),::Int64)::Any
v  h::Dict{Int64, Int64}.count

(The %4 = setindex!(::Vector{UInt8},::UInt8,::Int64)::Any call.) But when I check into this call, I get:

setindex!(A::Array{T}, x, i1::Int64) where T @ Base array.jl:969
969  (setindex!(A::Vector{UInt8}::Array{T}, x::UInt8, i1::Int64::Int) where {T})::Vector{UInt8} = arrayset($(Expr(:boundscheck)), A::Vector{UInt8}, (convert(T::Type{UInt8},x::UInt8)::UInt8::T::Type{UInt8})::UInt8, i1::Int64)
Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark.
Toggles: [w]arn, [h]ide type-stable statements, [t]ype annotations, [s]yntax highlight for Source/LLVM/Native.
Show: [S]ource code, [A]ST, [T]yped code, [L]LVM IR, [N]ative code
Actions: [E]dit source code, [R]evise and redisplay
 • convert(T::Type{UInt8},x::UInt8)

I’m a bit confused here. Where is the Any coming from in the previous call, if there’s nothing here? Should I care at all about the Any since whatever output is coming from delete! isn’t going to be used anyway?

2 Likes