JuliaApproximation / ApproxFun.jl

Julia package for function approximation
http://juliaapproximation.github.io/ApproxFun.jl/
Other
541 stars 70 forks source link

making Fun from integer-valued function might give misleading error message #50

Closed goretkin closed 9 years ago

goretkin commented 9 years ago

not sure if this is a legitimate issue, but

julia> Fun(x->2,d)
ERROR: type: chebyshevtransform: in typeassert, expected Array{Int64,1}, got Array{Float64,1}
 in chebyshevtransform at /Users/goretkin/.julia/v0.3/ApproxFun/src/LinearAlgebra/chebyshevtransform.jl:32
 in chebyshevtransform at /Users/goretkin/.julia/v0.3/ApproxFun/src/LinearAlgebra/chebyshevtransform.jl:27
 in transform at /Users/goretkin/.julia/v0.3/ApproxFun/src/Spaces/Ultraspherical/ChebyshevSpace.jl:22
 in Fun at /Users/goretkin/.julia/v0.3/ApproxFun/src/Fun/constructors.jl:10
 in zerocfsFun at /Users/goretkin/.julia/v0.3/ApproxFun/src/Fun/constructors.jl:89
 in Fun at /Users/goretkin/.julia/v0.3/ApproxFun/src/Fun/constructors.jl:137
 in Fun at /Users/goretkin/.julia/v0.3/ApproxFun/src/Fun/constructors.jl:142

The error is not directly related to it, but it might trip someone up that they see expected Array{Int64,1}, got Array{Float64,1}, when in fact the issue is that the function is returning Int64 instead of Float64

dlfivefifty commented 9 years ago

Fixed.