Skip to content

Commit

Permalink
Implement LinearAlgebra.haszero trait to fix Julia nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed May 21, 2024
1 parent ba2ded5 commit 7e27dc9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -568,3 +568,12 @@ function Base.complex(
)
return r + im * i
end

if VERSION >= v"1.11.0-alpha1" && isdefined(LinearAlgebra, :haszero)
# See JuMP.jl#3752 for details.
# Introduced by https://github.com/JuliaLang/julia/pull/52528
LinearAlgebra.haszero(::Type{<:AbstractVariableRef}) = true
LinearAlgebra.haszero(::Type{<:GenericAffExpr}) = true
LinearAlgebra.haszero(::Type{<:GenericQuadExpr}) = true
LinearAlgebra.haszero(::Type{<:GenericNonlinearExpr}) = true

Check warning on line 578 in src/operators.jl

View check run for this annotation

Codecov / codecov/patch

src/operators.jl#L575-L578

Added lines #L575 - L578 were not covered by tests
end

0 comments on commit 7e27dc9

Please sign in to comment.