Skip to content

Commit ab79a1b

Browse files
committed
explicit return nothing
1 parent 56f4601 commit ab79a1b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/OptimizationMOI/src/nlp.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ function MOI.eval_constraint_jacobian_product(
309309
else
310310
error("Thou shalt provide the v'J of the constraint jacobian, not doing so is associated with great misfortune and also no ice cream for you.")
311311
end
312+
return nothing
312313
end
313314

314315
function MOI.eval_constraint_jacobian_transpose_product(
@@ -326,6 +327,7 @@ function MOI.eval_constraint_jacobian_transpose_product(
326327
else
327328
error("Thou shalt provide the v'J of the constraint jacobian, not doing so is associated with great misfortune and also no ice cream for you.")
328329
end
330+
return nothing
329331
end
330332

331333
function MOI.hessian_lagrangian_structure(evaluator::MOIOptimizationNLPEvaluator)

lib/OptimizationMOI/test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ end
4747
@test (evaluator.f.cons_j !== nothing) || (evaluator.f.cons_jvp !== nothing)
4848
y = zeros(1)
4949
w = ones(2)
50-
@test MathOptInterface.eval_constraint_jacobian_product(evaluator, y, x, w) isa Any
50+
@test MathOptInterface.eval_constraint_jacobian_product(evaluator, y, x, w) === nothing
5151

5252
# constraint jacobian-vector product
5353
@test (evaluator.f.cons_j !== nothing) || (evaluator.f.cons_vjp !== nothing)
5454
y = zeros(2)
5555
w = ones(1)
5656
@test MathOptInterface.eval_constraint_jacobian_transpose_product(
57-
evaluator, y, x, w) isa Any
57+
evaluator, y, x, w) === nothing
5858
end
5959

6060
@testset "NLP" begin

0 commit comments

Comments
 (0)