Dear Julia Experts, please, what’s wrong with the following? Can’t I make a vector that is a union of two different numerical types, i.e. a vector of either Int64
or Float64
elements?
IntFloat = Union{Int64, Float64}
function fun(x::Vector{IntFloat})
println(x)
end
fun(Int64[1, 2, 3])
fun(Float64[1, 2, 3])