diff --git a/src/forwarddiff.jl b/src/forwarddiff.jl index f05918008..ec3612fa3 100644 --- a/src/forwarddiff.jl +++ b/src/forwarddiff.jl @@ -363,11 +363,14 @@ function anyeltypedual(x::NamedTuple, ::Type{Val{counter}} = Val{0}) where {coun anyeltypedual(values(x)) end -function DiffEqBase.anyeltypedual( +function anyeltypedual( f::SciMLBase.AbstractSciMLFunction, ::Type{Val{counter}}) where {counter} Any end +anyeltypedual(::@Kwargs{}, ::Type{Val{counter}} = Val{0}) where {counter} = Any +anyeltypedual(::Type{@Kwargs{}}, ::Type{Val{counter}} = Val{0}) where {counter} = Any + @inline promote_u0(::Nothing, p, t0) = nothing @inline function promote_u0(u0, p, t0) diff --git a/test/forwarddiff_dual_detection.jl b/test/forwarddiff_dual_detection.jl index f3417d58d..292c48d9e 100644 --- a/test/forwarddiff_dual_detection.jl +++ b/test/forwarddiff_dual_detection.jl @@ -162,7 +162,7 @@ for p in p_possibilities_missed end p_possibilities_notdual = [ - (), (;), [2.0], [2.0, 2], [2.0, (2.0)], [2.0, MyStruct(2.0, 2.0f0)] + (), (;), [2.0], [2.0, 2], [2.0, (2.0)], [2.0, MyStruct(2.0, 2.0f0)], pairs((;)) ] for p in p_possibilities_notdual