-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
non-sensical MethodError #5559
Comments
Maybe related to the convert issue I raised a week or two ago? |
For the method that's throwing, code_typed(convert, (Type{ZPKFilter}, TFFilter{Float64}))
1-element Array{Any,1}:
:($(Expr(:lambda, {:#s68,:f}, {{:k,:b,:z,:p},{{:#s68,Type{ZPKFilter{Z,P,K}},0},{:f,TFFilter{Float64},0},{:k,Float64,18},{:b,Poly{Float64},18},{:z,Array{Complex{Float64},1},18},{:p,Array{Complex{Float64},1},18}},{}}, quote # /Users/simon/.julia/DSP/src/filter_design.jl, line 107:
k = arrayref(top(getfield)(top(getfield)(f::TFFilter{Float64},:b)::Poly{Float64},:a)::Array{Float64,1},top(box)(Int64,top(add_int)(1,top(getfield)(top(getfield)(f::TFFilter{Float64},:b)::Poly{Float64},:nzfirst)::Int64))::Int64)::Float64 # line 108:
b = /(top(getfield)(f::TFFilter{Float64},:b)::Poly{Float64},k::Float64)::Poly{Float64} # line 109:
z = convert_default($(Array{Complex{Float64},1}),roots(b::Poly{Float64})::AbstractArray{T,N},convert)::Array{Complex{Float64},1} # line 110:
p = convert_default($(Array{Complex{Float64},1}),roots(top(getfield)(f::TFFilter{Float64},:a)::Poly{Float64})::AbstractArray{T,N},convert)::Array{Complex{Float64},1} # line 111:
return $(Expr(:new, ZPKFilter{Complex{Float64},Complex{Float64},Float64}, :(z::Array{Complex{Float64},1}), :(p::Array{Complex{Float64},1}), :(k::Float64)))::ZPKFilter{Complex{Float64},Complex{Float64},Float64}
end))) It fails at the code_typed(convert, (Type{ZPKFilter}, TFFilter{Float64}))
1-element Array{Any,1}:
:($(Expr(:lambda, {:#s62,:f}, {{:k,:b,:z,:p},{{:#s62,Type{ZPKFilter{Z,P,K}},0},{:f,TFFilter{Float64},0},{:k,Float64,18},{:b,Poly{Float64},18},{:z,Array{Complex{Float64},1},18},{:p,Array{Complex{Float64},1},18}},{}}, quote # /Users/simon/.julia/DSP/src/filter_design.jl, line 107:
k = arrayref(top(getfield)(top(getfield)(f::TFFilter{Float64},:b)::Poly{Float64},:a)::Array{Float64,1},top(box)(Int64,top(add_int)(1,top(getfield)(top(getfield)(f::TFFilter{Float64},:b)::Poly{Float64},:nzfirst)::Int64))::Int64)::Float64 # line 108:
b = /(top(getfield)(f::TFFilter{Float64},:b)::Poly{Float64},k::Float64)::Poly{Float64} # line 109:
z = convert($(Array{Complex{Float64},1}),roots(b::Poly{Float64})::Array{T,1})::Array{Complex{Float64},1} # line 110:
p = convert($(Array{Complex{Float64},1}),roots(top(getfield)(f::TFFilter{Float64},:a)::Poly{Float64})::Array{T,1})::Array{Complex{Float64},1} # line 111:
return $(Expr(:new, ZPKFilter{Complex{Float64},Complex{Float64},Float64}, :(z::Array{Complex{Float64},1}), :(p::Array{Complex{Float64},1}), :(k::Float64)))::ZPKFilter{Complex{Float64},Complex{Float64},Float64}
end))) |
Reduced test case: julia> f() = convert(Vector{Complex128}, AbstractArray[[1.0]][1]);
julia> f()
ERROR: no method convert(Type{Array{Complex{Float64},1}}, Array{Float64,1})
in f at none:1 This fails both before and after 6002358 (and all the way back to at least 0.2). The reason |
The tests for DSP.jl master are currently failing with a MethodError (JuliaDSP/DSP.jl#19):
That method definitely exists: We are importing
convert
from Base before extending it, and insertingprint(code_lowered(convert, (Type{Array{Complex{Float64},1}}, Array{Float64,1})))
above the line that throws shows the method source.git bisect
shows that the error first appears with 6002358 (cc @JeffBezanson).The text was updated successfully, but these errors were encountered: