FFTW.jl
FFTW.jl copied to clipboard
Inference failure in brfft on 0.7
From the Travis log (also seeing locally):
ERROR: LoadError: return type Array{Float64,2} does not match inferred return type Any
Stacktrace
[1] macro expansion at /home/travis/.julia/v0.7/FFTW/test/runtests.jl:335 [inlined]
[2] anonymous at ./<missing>:?
[3] include_relative(::Module, ::String) at ./loading.jl:464
[4] include(::Module, ::String) at ./sysimg.jl:14
[5] process_options(::Base.JLOptions) at ./client.jl:315
[6] _start() at ./client.jl:383
while loading /home/travis/.julia/v0.7/FFTW/test/runtests.jl, in expression starting on line 331
The line that's being hit is equivalent to @inferred brfft(randn(10), 18)
. Oddly enough, running that from the REPL works fine for me.
My bad, I can reproduce this at the REPL; I had the trigger of the error wrong. The code is
@inferred brfft(randn(10, 12), 18)
It's the 2-dimensional input case that can't be inferred.
Checking out aa/dft on AbstractFFTs, aa/ugh-oh-my-god on FFTW, current Julia master:
julia> using FFTW, AbstractFFTs, Base.Test
julia> x = randn(10, 12);
julia> @inferred brfft(x, 18);
ERROR: return type Array{Float64,2} does not match inferred return type Any
Stacktrace:
[1] error(::String) at ./error.jl:28
julia> @inferred brfft(AbstractFFTs.complexfloat(x), 18);
The interesting thing about this is that brfft(x, d)
calls brfft(complexfloat(x), d)
, and the latter is inferred correctly while the former is not.
I've been talking with @JeffBezanson about this a bit but I'm having difficulty putting together a reduced reproducible case. Do you have any insight on this, @stevengj?
I haven't been able to figure this out nor isolate it further, so if anyone could lend a hand or provide some insight, that would be very much appreciated.