NumericExtensions.jl
NumericExtensions.jl copied to clipboard
ERROR: no method result_type
I got this error with a recent build of julia and NumericExtensions 0.6.1 using my own functors.
For example:
julia> using NumericExtensions
julia> type MySqr <: Functor{1} end
julia> NumericExtensions.evaluate(::MySqr, x) = x*x
evaluate (generic function with 143 methods)
julia> map(MySqr(), rand(10))
ERROR: no method result_type(MySqr, Type{Float64})
in map at /Users/sam/.julia/v0.3/NumericExtensions/src/map.jl:28
Adding the method
NumericExtensions.result_type{T<:Number}(::MySqr, ::Type{T}) = T (or more generally, ::Functor{1} for the first argument) fixed the error, but I'm not sure where it came from in the first place. I don't see anything in recent commits to NumericExtensions or NumericFuns that jumps out at me. Maybe it's some change in Base?
The recent commit removes the fallback of result_type. Will add it back soon.