From ab79a1bd60d647753a507942853bd57f1fe3a3e6 Mon Sep 17 00:00:00 2001 From: Andrew Leonard Date: Tue, 29 Oct 2024 15:42:59 -0400 Subject: [PATCH] explicit return nothing --- lib/OptimizationMOI/src/nlp.jl | 2 ++ lib/OptimizationMOI/test/runtests.jl | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/OptimizationMOI/src/nlp.jl b/lib/OptimizationMOI/src/nlp.jl index 454a68215..24301e29a 100644 --- a/lib/OptimizationMOI/src/nlp.jl +++ b/lib/OptimizationMOI/src/nlp.jl @@ -309,6 +309,7 @@ function MOI.eval_constraint_jacobian_product( else 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.") end + return nothing end function MOI.eval_constraint_jacobian_transpose_product( @@ -326,6 +327,7 @@ function MOI.eval_constraint_jacobian_transpose_product( else 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.") end + return nothing end function MOI.hessian_lagrangian_structure(evaluator::MOIOptimizationNLPEvaluator) diff --git a/lib/OptimizationMOI/test/runtests.jl b/lib/OptimizationMOI/test/runtests.jl index 08a3f83b6..f1002b3f0 100644 --- a/lib/OptimizationMOI/test/runtests.jl +++ b/lib/OptimizationMOI/test/runtests.jl @@ -47,14 +47,14 @@ end @test (evaluator.f.cons_j !== nothing) || (evaluator.f.cons_jvp !== nothing) y = zeros(1) w = ones(2) - @test MathOptInterface.eval_constraint_jacobian_product(evaluator, y, x, w) isa Any + @test MathOptInterface.eval_constraint_jacobian_product(evaluator, y, x, w) === nothing # constraint jacobian-vector product @test (evaluator.f.cons_j !== nothing) || (evaluator.f.cons_vjp !== nothing) y = zeros(2) w = ones(1) @test MathOptInterface.eval_constraint_jacobian_transpose_product( - evaluator, y, x, w) isa Any + evaluator, y, x, w) === nothing end @testset "NLP" begin