Hello, could you please help me to understand the following code. I think the types line up really nicely, but Julia 1.2 thinks otherwise.
d = 2
a1 = [0.0]
a2 = [0.0]
b1 = zeros(d, 1)
b2 = zeros(d, 1)
c1 = [0.0]
c2 = [0.0]
function test1(a::AbstractVector{AbstractVector{T}},
b::AbstractVector{AbstractMatrix{T}},
c::AbstractVector{AbstractVector{T}}
) where T <: AbstractFloat
return "Done!"
end
This seems fine:
methods(test1)
1 method for generic function “test1”:
[1] test1(a::AbstractArray{AbstractArray{T,1},1}, b::AbstractArray{AbstractArray{T,2},1}, c::AbstractArray{AbstractArray{T,1},1}) where T<:AbstractFloat in Main at typeerror.jl:13
But this fails:
test1([a1, a2], [b1, b2], [c1, c2])
ERROR: MethodError: no method matching test1(::Array{Array{Float64,1},1}, ::Array{Array{Float64,2},1}, ::Array{Array{Float64,1},1})
Stacktrace:
[1] top-level scope at REPL[3]:1