diff --git a/src/FlatZinc/model.jl b/src/FlatZinc/model.jl index c9bd998a..e36ce1ac 100644 --- a/src/FlatZinc/model.jl +++ b/src/FlatZinc/model.jl @@ -102,6 +102,8 @@ function MOI.get(model::Model, ::MOI.ObjectiveFunction{MOI.VariableIndex}) return model.objective_function end +MOI.supports(::Model, ::MOI.ObjectiveFunction{MOI.VariableIndex}) = true + function MOI.set( model::Model, ::MOI.ObjectiveFunction{MOI.VariableIndex}, diff --git a/test/FlatZinc/model.jl b/test/FlatZinc/model.jl index 742a7622..f4b3cb17 100644 --- a/test/FlatZinc/model.jl +++ b/test/FlatZinc/model.jl @@ -7,6 +7,10 @@ @testset "Supported constraints" begin m = CP.FlatZinc.Model() + @test MOI.supports( + m, + MOI.ObjectiveFunction{MOI.VariableIndex}(), + ) @test MOI.supports_constraint( m, MOI.VariableIndex, @@ -105,4 +109,4 @@ @test MOI.supports_add_constrained_variable(m, S) @test MOI.supports_add_constrained_variables(m, S) end -end \ No newline at end of file +end