Skip to content

Commit f09a1bb

Browse files
committed
Fix
1 parent 2f6579f commit f09a1bb

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/ArrayDiff.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,13 @@ include("evaluator.jl")
5656
include("array_nonlinear_function.jl")
5757
include("parse_moi.jl")
5858

59-
# Tell MOI to create an ArrayDiff.Model when Mode() is the AD backend.
60-
Nonlinear.model(::Mode) = Model()
59+
if isdefined(Nonlinear, :model)
60+
# Needs https://github.com/jump-dev/MathOptInterface.jl/pull/2989
61+
# Remove this `if` when it's part of a released version of MOI
62+
63+
# Tell MOI to create an ArrayDiff.Model when Mode() is the AD backend.
64+
Nonlinear.model(::Mode) = Model()
65+
end
6166

6267
# Extend MOI.Nonlinear.set_objective so that solvers calling
6368
# MOI.Nonlinear.set_objective(arraydiff_model, snf) dispatch here.

0 commit comments

Comments
 (0)