# Calling module specific method with same type signature (AbstractFFT, FFTW, FFTA)

**URL:** https://discourse.julialang.org/t/calling-module-specific-method-with-same-type-signature-abstractfft-fftw-ffta/128750
**Category:** General Usage
**Tags:** question, methods
**Created:** [May 6, 2025, 11:35am UTC](https://discourse.julialang.org/t/calling-module-specific-method-with-same-type-signature-abstractfft-fftw-ffta/128750 "2025-05-06T11:35:35Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![jtravs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jtravs/32/2010_2.png) [@jtravs](https://discourse.julialang.org/u/jtravs)
#### Post date: [May 6, 2025, 11:35am UTC](https://discourse.julialang.org/t/calling-module-specific-method-with-same-type-signature-abstractfft-fftw-ffta/128750/1 "2025-05-06T11:35:35Z")

</div>

Consider the following example. If I run

```julia
using FFTA
a = rand(ComplexF64, 128)
p = FFTA.plan_fft(a)
typeof(p)

```

I get

```julia
FFTA.FFTAPlan_cx{ComplexF64, 1}

```

but if I run

```julia
using FFTA, FFTW
a = rand(ComplexF64, 128)
p = FFTA.plan_fft(a)
typeof(p)

```

I get

```julia
FFTW.cFFTWPlan{ComplexF64, -1, false, 1, Tuple{Int64}}

```

Of course, both `FFTA.plan_fft` and `FFTW.plan_fft` are methods of `AbstractFFTs.plan_fft` with the same type signature.

I thought this was a bug in FFTA.jl, but now I am not so sure ([FFTA.plan\_fft returns an FFTW plan if both FFTW and FFTA are used · Issue #66 · JuliaMath/FFTA.jl · GitHub](https://github.com/JuliaMath/FFTA.jl/issues/66)). Is there any way to call the FFTA.jl specific method?

This problem arises because my project uses both FFTW and FFTA (in different places/modules). But even if I remove FFTW from my package, it still arises after importing an external package that does use FFTW.

---

<div class="post-metadata">

### Author: ![danielwe](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/danielwe/32/35657_2.png) [@danielwe](https://discourse.julialang.org/u/danielwe)
#### Post date: [May 6, 2025, 2:59pm UTC](https://discourse.julialang.org/t/calling-module-specific-method-with-same-type-signature-abstractfft-fftw-ffta/128750/2 "2025-05-06T14:59:12Z")

</div>

The problem is ultimately that the AbstractFFTs.jl interface does type piracy by design, which is a recipe for disaster precisely because of this:

> [@jtravs](#):
>
> even if I remove FFTW from my package, it still arises after importing an external package that does use FFTW.

I don’t know of a solution other than, say, using your own fork of FFTA.jl where you strip out the AbstractFFTs.jl dependency and implement a separate `FFTA.plan_fft`.

As mentioned in the issue, the proper solution would be adding some kind of backend token similar to the `Auto<adbackend>` types used by autodiff interface packages. Since FFT is so fundamental, such a breaking change would probably cause a lot of churn across the ecosystem, so likely a lot of people would be resistant to the idea, but what are you going to do? As your example shows, the current situation is not tenable.
