Skip to content

Commit 97877c8

Browse files
Use public type promotion in OptimizationBase QA
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
1 parent 7618ca9 commit 97877c8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/OptimizationBase/src/OptimizationDIExt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ using OptimizationBase.FastClosures
2424

2525
# Output-buffer eltype for the `p`-accepting constraint wrapper: the type `f.cons` produces,
2626
# including the *nested* dual when both `x` (DI's seeds) and `p` (the sensitivity layer) carry
27-
# duals with different tags (`promote_op(+, …)` nests them). Deliberately uses plain `eltype(p)`
27+
# duals with different tags (`promote_type` nests them). Deliberately uses plain `eltype(p)`
2828
# rather than `SciMLBase.anyeltypedual`: this runs *inside* the DI-differentiated wrapper, and
2929
# Enzyme's forward mode corrupts the derivative shadow (DataType-valued entries) when the
3030
# allocation type flows through `anyeltypedual` — in either its value or its type-level form,
@@ -36,7 +36,7 @@ using OptimizationBase.FastClosures
3636
Tu = eltype(x)
3737
p isa Union{SciMLBase.NullParameters, Nothing} && return Tu
3838
Tp = eltype(p)
39-
return Tp <: Number ? Base.promote_op(+, Tu, Tp) : Tu
39+
return Tp <: Number ? promote_type(Tu, Tp) : Tu
4040
end
4141

4242
function instantiate_function(

0 commit comments

Comments
 (0)