Skip to content

Commit

Permalink
Fix and test InexactError
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Jul 2, 2023
1 parent 551f793 commit 2acb6d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1213,8 +1213,8 @@ function Base.convert(
::Type{VectorAffineFunction{T}},
f::VectorQuadraticFunction{T},
) where {T}
if any(!iszero(t.coef) for t in f.quadratic_terms)
throw(InexactError, :convert, VectorAffineFunction{T}, f)
if any(!iszero(t.scalar_term.coefficient) for t in f.quadratic_terms)
throw(InexactError(:convert, VectorAffineFunction{T}, f))
end
return VectorAffineFunction{T}(f.affine_terms, f.constants)
end
Expand Down

0 comments on commit 2acb6d0

Please sign in to comment.