Skip to content

Commit c2e7131

Browse files
removed generated function
1 parent 05caad6 commit c2e7131

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

ext/DiffEqBaseForwardDiffExt.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,6 @@ if !hasmethod(nextfloat, Tuple{ForwardDiff.Dual})
215215
end
216216
end
217217

218-
# bisection(f, tup::Tuple{T,T}, t_forward::Bool) where {T<:ForwardDiff.Dual} = find_zero(f, tup, Roots.AlefeldPotraShi())
219-
220218
# Static Arrays don't support the `init` keyword argument for `sum`
221219
@inline __sum(f::F, args...; init, kwargs...) where {F} = sum(f, args...; init, kwargs...)
222220
@inline function __sum(

src/utils.jl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -190,23 +190,22 @@ upconversion is not done automatically, the user is required to upconvert all in
190190
themselves, for an example of how this can be confusing to a user see
191191
https://discourse.julialang.org/t/typeerror-in-julia-turing-when-sampling-for-a-forced-differential-equation/82937
192192
"""
193-
@generated function anyeltypedual(x, ::Type{Val{counter}} = Val{0}) where {counter}
194-
x = x.name === Core.Compiler.typename(Type) ? x.parameters[1] : x
195-
if isdualtype(x)
196-
:($x)
193+
function anyeltypedual(x, ::Type{Val{counter}} = Val{0}) where {counter}
194+
if isdualtype(typeof(x))
195+
x
197196
elseif fieldnames(x) === ()
198-
:(Any)
197+
Any
199198
elseif counter < DUALCHECK_RECURSION_MAX
200199
T = diffeqmapreduce(x -> anyeltypedual(x, Val{counter + 1}), promote_dual,
201200
x.parameters)
202201
if T === Any || isconcretetype(T)
203-
:($T)
202+
T
204203
else
205-
:(diffeqmapreduce(DualEltypeChecker($x, $counter + 1), promote_dual,
206-
map(Val, fieldnames($(typeof(x))))))
204+
diffeqmapreduce(DualEltypeChecker(typeof(x), counter + 1), promote_dual,
205+
map(Val, fieldnames((typeof(x)))))
207206
end
208207
else
209-
:(Any)
208+
Any
210209
end
211210
end
212211

0 commit comments

Comments
 (0)