diff --git a/base/fft/ctfft.jl b/base/fft/ctfft.jl index e94babf8f8f13..8965ffb67e4db 100644 --- a/base/fft/ctfft.jl +++ b/base/fft/ctfft.jl @@ -103,9 +103,9 @@ function CTPlan{Tr<:FloatingPoint}(::Type{Complex{Tr}}, forward::Bool, n::Int) end plan_fft{Tr<:FloatingPoint}(x::AbstractVector{Complex{Tr}}) = - CTPlan(Complex{Tr}, true, length(x)) + CTPlan(Complex{Tr}, true, length(x))::CTPlan{Complex{Tr},true} plan_bfft{Tr<:FloatingPoint}(x::AbstractVector{Complex{Tr}}) = - CTPlan(Complex{Tr}, false, length(x)) + CTPlan(Complex{Tr}, false, length(x))::CTPlan{Complex{Tr},false} function applystep{T}(p::CTPlan{T}, x::AbstractArray{T}, x0, xs, diff --git a/base/fft/fftn.jl b/base/fft/fftn.jl index c9883cc045f6f..fa7dc726c51bf 100644 --- a/base/fft/fftn.jl +++ b/base/fft/fftn.jl @@ -49,9 +49,9 @@ function MultiDimPlan{T<:Complex}(::Type{T}, forward::Bool, region, sz) end plan_fft{Tr<:FloatingPoint}(x::AbstractArray{Complex{Tr}}, region) = - MultiDimPlan(Complex{Tr}, true, region, size(x)) + MultiDimPlan(Complex{Tr}, true, region, size(x))::MultiDimPlan{Complex{Tr}, true} plan_bfft{Tr<:FloatingPoint}(x::AbstractArray{Complex{Tr}}, region) = - MultiDimPlan(Complex{Tr}, false, region, size(x)) + MultiDimPlan(Complex{Tr}, false, region, size(x))::MultiDimPlan{Complex{Tr}, false} # recursive execution of a MultiDim plan, starting at dimension d, for # strided arrays (so that we can use linear indexing): diff --git a/test/fft.jl b/test/fft.jl index 857ff801d05a8..9f9f6b07f7d41 100644 --- a/test/fft.jl +++ b/test/fft.jl @@ -356,3 +356,18 @@ for T in (Complex128, Complex{BigFloat}) end end end + +# issue #9772 +for x in (randn(10),randn(10,12)) + z = complex(x) + y = rfft(x) + @inferred rfft(x) + @inferred brfft(x,18) + @inferred brfft(y,10) + for f in (fft,plan_fft,bfft,plan_bfft,fft_) + @inferred f(x) + @inferred f(z) + end + # note: inference doesn't work for plan_fft_ since the + # algorithm steps are included in the CTPlan type +end