I made a function called jacobian that creates 4 sparse matrices with Float64 entries, make the calculations, and depending on the keyword argument stacked being true or false, returns all four separately,
return A1, A2, A3, A4,
or stacked as a single matrix,
return vcat(hcat(A1,A2), hcat(A3,A4)).
Running the function with the @code_warntype macro gives me the warning:
Body::Union{NTuple{4,SparseMatrixCSC{Float64,Int64}}, SparseMatrixCSC{Float64,Int64}}
1 ─ %1 = Main.:(var"#jacobian#29")(false, #self#, Y, V)::Union{NTuple{4,SparseMatrixCSC{Float64,Int64}}, SparseMatrixCSC{Float64,Int64}}
└── return %1
with the ::Union... parts marked in red, which I don't think is a good sign. Is this considered type instablility? If yes, how can I solve this?
Thanks!