diff --git a/src/forwarddiff.jl b/src/forwarddiff.jl index 9a4d00ac9..ec3ad87af 100644 --- a/src/forwarddiff.jl +++ b/src/forwarddiff.jl @@ -113,6 +113,7 @@ end anyeltypedual(x::Union{ForwardDiff.AbstractConfig, Module}, counter = 0) = Any anyeltypedual(x::Type{T}, counter = 0) where {T <: ForwardDiff.AbstractConfig} = Any anyeltypedual(x::SciMLBase.RecipesBase.AbstractPlot, counter = 0) = Any +anyeltypedual(x::Returns, counter = 0) = anyeltypedual(x.value, counter) if isdefined(PreallocationTools, :FixedSizeDiffCache) anyeltypedual(x::PreallocationTools.FixedSizeDiffCache, counter = 0) = Any diff --git a/test/forwarddiff_dual_detection.jl b/test/forwarddiff_dual_detection.jl index a5a13453f..5e338f8d1 100644 --- a/test/forwarddiff_dual_detection.jl +++ b/test/forwarddiff_dual_detection.jl @@ -85,8 +85,7 @@ p_possibilities17 = [ (Mod, ForwardDiff.Dual(2.0)), (() -> 2.0, ForwardDiff.Dual(2.0)), (Base.pointer([2.0]), ForwardDiff.Dual(2.0)), ] -VERSION >= v"1.7" && VERSION < v"1.9" && - push!(p_possibilities17, Returns((a = 2, b = 1.3, c = ForwardDiff.Dual(2.0f0)))) +VERSION >= v"1.7" && push!(p_possibilities17, Returns((a = 2, b = 1.3, c = ForwardDiff.Dual(2.0f0)))) for p in p_possibilities17 @show p @@ -128,7 +127,6 @@ p_possibilities_uninferrred = [ (; x = Vector{Float64}(undef, 2), y = [[MyStruct3(ForwardDiff.Dual(2.0))]]), (; x = Matrix{Any}(undef, 2, 2), y = [[MyStruct3(ForwardDiff.Dual(2.0))]]), ] -VERSION >= v"1.9" && push!(p_possibilities_uninferrred, Returns((a = 2, b = 1.3, c = ForwardDiff.Dual(2.0f0))))