I'm updating ApproxFun and this caught me by surprise:
abstract Foo
julia> (f::Foo)(x)=x
ERROR: cannot add methods to an abstract type
in eval(::Module, ::Any) at ./boot.jl:267
Is this intentional? Is there a way to get around this other than define for each subtype:
julia> immutable CFoo <: Foo end
julia> (f::CFoo)(x)=x
I'm updating ApproxFun and this caught me by surprise:
Is this intentional? Is there a way to get around this other than define for each subtype: