Skip to content

ERROR: no method result_type #38

Description

@lendle

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions