Skip to content

Commit aa6ac48

Browse files
committed
Update
1 parent e9bf29d commit aa6ac48

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/FileFormats/NL/read.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ function _expr_to_function(expr::Expr)
234234
@assert Meta.isexpr(expr, :call)
235235
f = _try_scalar_affine_function(expr)
236236
if f !== nothing
237-
return f
237+
return convert(MOI.ScalarAffineFunction{Float64}, f)
238238
end
239239
return MOI.ScalarNonlinearFunction(
240240
expr.args[1],

test/FileFormats/NL/read.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -720,10 +720,10 @@ function test_hs071_free_constraint_nlexpr()
720720
open(joinpath(@__DIR__, "data", "hs071_free_constraint.nl"), "r") do io
721721
return read!(io, model)
722722
end
723-
@test MOI.get(model, MOI.ListOfConstraintTypesPresent()) == [
724-
(MOI.ScalarNonlinearFunction, MOI.GreaterThan{Float64}),
725-
(MOI.ScalarNonlinearFunction, MOI.Interval{Float64}),
726-
]
723+
types = MOI.get(model, MOI.ListOfConstraintTypesPresent())
724+
@test length(types) == 2
725+
@test (MOI.ScalarAffineFunction{Float64}, MOI.GreaterThan{Float64}) in types
726+
@test (MOI.ScalarNonlinearFunction, MOI.Interval{Float64}) in types
727727
for (F, S) in MOI.get(model, MOI.ListOfConstraintTypesPresent())
728728
@test MOI.get(model, MOI.NumberOfConstraints{F,S}()) == 1
729729
end

0 commit comments

Comments
 (0)