NumericExtensions.jl icon indicating copy to clipboard operation
NumericExtensions.jl copied to clipboard

ERROR: no method result_type

Open lendle opened this issue 11 years ago • 1 comments

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?

lendle avatar Apr 08 '14 06:04 lendle

The recent commit removes the fallback of result_type. Will add it back soon.

lindahua avatar Apr 09 '14 11:04 lindahua