Skip to content

Commit

Permalink
Implement LinearAlgebra.haszero trait to fix Julia nightly (#3753)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored May 21, 2024
1 parent ba2ded5 commit 44a7591
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
end

0 comments on commit 44a7591

Please sign in to comment.