Skip to content

Commit e8838e4

Browse files
martinholtersararslan
authored andcommitted
Use triangular dispatch in eltype definition (#11)
1 parent 862afdc commit e8838e4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/definitions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Base: show, summary, size, ndims, length, eltype,
88
# DFT plan where the inputs are an array of eltype T
99
abstract type Plan{T} end
1010

11-
eltype(::Type{Plan{T}}) where {T} = T
11+
eltype(::Type{<:Plan{T}}) where {T} = T
1212

1313
# size(p) should return the size of the input array for p
1414
size(p::Plan, d) = size(p)[d]

test/runtests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ Base.:*(p::InverseTestPlan, x::Vector) = mul!(copy(x), p, x)
6363

6464
fftw_ifft = [Complex{Float64}(i, 0) for i in 1:8]
6565
@test AbstractFFTs.ifft(x) fftw_ifft
66+
67+
@test eltype(plan_fft(collect(1:8))) == Int
6668
end
6769

6870
@testset "Shift functions" begin

0 commit comments

Comments
 (0)