Hello,
I’m using vcat()
to concatenate many vectors, but I observed that @code_warntype
it’s returning a red mark. I marked with *** in the code below:
julia> a = collect(1:10);
julia> b = collect(20:30);
julia> @code_warntype vcat(a, b)
Variables
#self#::Core.Compiler.Const(vcat, false)
arrays::Tuple{Array{Int64,1},Array{Int64,1}}
n::Int64
@_4::Union{Nothing, Tuple{Array{Int64,1},Int64}}
arr::Array{Int64,1}
nd::Int64
@_7::Union{Nothing, Tuple{Array{Int64,1},Int64}}
a@_8::Array{Int64,1}
na::Int64
msg::Expr
a@_11::Array{Int64,1}
**********************
@_12::**Any** HERE
Body::Array{Int64,1}
1 ── Core.NewvarNode(:(arr))
│ Core.NewvarNode(:(nd))
│ Core.NewvarNode(:(@_7))
│ (n = 0)
│ %5 = arrays::Tuple{Array{Int64,1},Array{Int64,1}}
│ (@_4 = Base.iterate(%5))
│ %7 = (@_4 === nothing)::Bool
│ %8 = Base.not_int(%7)::Bool
└─── goto #4 if not %8
2 ┄─ %10 = @_4::Tuple{Array{Int64,1},Int64}::Tuple{Array{Int64,1},Int64}
│ (a@_8 = Core.getfield(%10, 1))
│ %12 = Core.getfield(%10, 2)::Int64
│ %13 = n::Int64
│ %14 = Base.length(a@_8)::Int64
│ (n = %13 + %14)
│ (@_4 = Base.iterate(%5, %12))
│ %17 = (@_4 === nothing)::Bool
│ %18 = Base.not_int(%17)::Bool
└─── goto #4 if not %18
3 ── goto #2
4 ┄─ %21 = Core.apply_type(Base.Vector, $(Expr(:static_parameter, 1)))::Core.Compiler.Const(Array{Int64,1}, false)
│ (arr = (%21)(Base.undef, n))
│ (nd = 1)
│ %24 = arrays::Tuple{Array{Int64,1},Array{Int64,1}}
│ (@_7 = Base.iterate(%24))
│ %26 = (@_7 === nothing)::Bool
│ %27 = Base.not_int(%26)::Bool
└─── goto #13 if not %27
5 ┄─ Core.NewvarNode(:(msg))
│ %30 = @_7::Tuple{Array{Int64,1},Int64}::Tuple{Array{Int64,1},Int64}
│ (a@_11 = Core.getfield(%30, 1))
│ %32 = Core.getfield(%30, 2)::Int64
│ (na = Base.length(a@_11))
│ %34 = (nd + na)::Int64
│ %35 = Base.length(arr)::Int64
│ %36 = (1 + %35)::Int64
│ %37 = (%34 <= %36)::Bool
└─── goto #7 if not %37
6 ── goto #11
7 ── (msg = $(Expr(:copyast, :($(QuoteNode(:(nd + na <= 1 + length(arr))))))))
│ %41 = Base.isdefined(Base.Main, :Base)::Bool
└─── goto #9 if not %41
*********************** HERE *********
8 ── %43 = Base.getproperty(Base.Main, :Base)::**Any**
│ %44 = Base.getproperty(%43, :string)::**Any**
│ (@_12 = (%44)(msg))
└─── goto #10
*********************** HERE *********
9 ── %47 = Core.println::Core.Compiler.Const(Core.println, false)
│ (%47)(msg)
└─── (@_12 = "Error during bootstrap. See stdout.")
10 ┄ %50 = @_12::Any
│ %51 = Base.AssertionError(%50)::AssertionError
└─── Base.throw(%51)
11 ┄ Base.unsafe_copyto!(arr, nd, a@_11, 1, na)
│ (nd = nd + na)
│ (@_7 = Base.iterate(%24, %32))
│ %56 = (@_7 === nothing)::Bool
│ %57 = Base.not_int(%56)::Bool
└─── goto #13 if not %57
12 ─ goto #5
13 ┄ return arr