# How to interpret return type shown by Cthulhu?

**URL:** <https://discourse.julialang.org/t/how-to-interpret-return-type-shown-by-cthulhu/87145>\
**Category:** General Usage\
**Tags:** question, package, code\_warntype\
**Created:** [September 12, 2022, 2:36pm UTC](https://discourse.julialang.org/t/how-to-interpret-return-type-shown-by-cthulhu/87145 "2022-09-12T14:36:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jishnub](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jishnub/32/33620_2.png) [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Post date:** [September 12, 2022, 2:36pm UTC](https://discourse.julialang.org/t/how-to-interpret-return-type-shown-by-cthulhu/87145/1 "2022-09-12T14:36:33Z")

</div>

Looking at the output of `@descend_code_warntype reduce(vcat, eachcol(rand(2,2)))` on nightly, I find

```julia
Advanced: dump [P]arams cache.
   %69 = invoke throw_boundserror(::Matrix{Float64},::Tuple{Base.Slice{Base.OneTo{Int64}}, Int64})::Union{}
   %141 = invoke throw_setindex_mismatch(::SubArray{Float64, 1, Matrix{Float64}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true},::Tuple{Int64})::Union{}
 • %153 = invoke copyto!(::Matrix{Float64},::SubArray{Float64, 1, Matrix{Float64}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true})::Any
   ↩

```

The return type of `copyto!` is inferred as `Any`. However, if I select the call, I find

```julia
copyto!(dest::AbstractArray, src::AbstractArray) @ Base abstractarray.jl:1044
Body::Matrix{Float64}
1045 1 ─ %1 = Base.getfield(src, :indices)::Tuple{Base.Slice{Base.OneTo{Int64}}, Int64} │╻╷╷╷╷ isempty
     │ %2 = Core.getfield(%1, 1)::Base.Slice{Base.OneTo{Int64}} ││┃││ length
     │ %3 = Base.getfield(%2, :indices)::Base.OneTo{Int64} │││┃││╷╷ size
     │ %4 = Base.getfield(%3, :stop)::Int64 ││││╻╷ map
     │ %5 = (%4 === 0)::Bool ││╻ ==
     └── goto #3 if not %5 │       
     2 ─ return dest │       
     3 ─ nothing │       
1050 4 ─ %9 = invoke Base.unalias(dest::Matrix{Float64}, src::SubArray{Float64, 1, Matrix{Float64}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true})::SubArray{Float64, 1, Matrix{Float64}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true}
1051 │ %10 = invoke Base.copyto_unaliased!($(QuoteNode(IndexLinear()))::IndexLinear, dest::Matrix{Float64}, $(QuoteNode(IndexLinear()))::IndexLinear, %9::SubArray{Float64, 1, Matrix{Float64}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true})::Matrix{Float64}
     └── return %10 │       
Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark.
Toggles: [o]ptimize, [w]arn, [h]ide type-stable statements, [d]ebuginfo, [r]emarks, [e]ffects, [i]nlining costs, [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
Advanced: dump [P]arams cache.
 • %9 = invoke unalias(::Matrix{Float64},::SubArray{Float64, 1, Matrix{Float64}, Tuple{Base.Slice{Base.OneTo{Int64}}, Int64}, true})::…
   %10 = invoke copyto_unaliased!(::IndexLinear,::Array{…},::IndexLinear,::SubArray{…})::Matrix{Float64}
   ↩

```

In this, the return type seems to be concretely inferred as `Matrix{Float64}`. How do I interpret the return type displayed in the parent call?
