From 7f8be109f168b2d21f5ca860f6026fdde8754131 Mon Sep 17 00:00:00 2001 From: Beforerr Date: Thu, 14 May 2026 11:04:38 -0700 Subject: [PATCH] fix: reduce AbstractFFTs import latency --- src/TestUtils.jl | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/TestUtils.jl b/src/TestUtils.jl index 8816e1fd..c24aca6f 100644 --- a/src/TestUtils.jl +++ b/src/TestUtils.jl @@ -60,16 +60,11 @@ we allow specifying `copy_input=true` to allow for this behaviour in tests by co """ function test_plan_adjoint end -if isdefined(Base, :get_extension) && isdefined(Base.Experimental, :register_error_hint) - function __init__() - # Better error message if users forget to load Test - Base.Experimental.register_error_hint(MethodError) do io, exc, _, _ - if any(f -> (f === exc.f), (test_real_ffts, test_complex_ffts, test_plan, test_plan_adjoint)) && - (Base.get_extension(AbstractFFTs, :AbstractFFTsTestExt) === nothing) - print(io, "\nDid you forget to load Test?") - end - end - end -end +_test_extension_error() = throw(ArgumentError("Did you forget to load Test?")) + +test_complex_ffts(args...; kwargs...) = _test_extension_error() +test_real_ffts(args...; kwargs...) = _test_extension_error() +test_plan(args...; kwargs...) = _test_extension_error() +test_plan_adjoint(args...; kwargs...) = _test_extension_error() end