Vcat for Vector{Any}

You need parentheses to call vcat, i.e.

vcat(Vector{Any}(a_1), a_2)

Alternatively, you can use square brackets with a semicolon, and no vcat, which implicitly calls vcat:

[Vector{Any}(a_1); a_2]

Your code doesn’t give that error for me. The error message that I get from your code with vcat[...] is

ERROR: MethodError: no method matching getindex(::typeof(vcat), ...)

which makes sense because vcat[...] is equivalent to getindex(vcat, ...).

1 Like