diff --git a/src/aff_expr.jl b/src/aff_expr.jl index b027cf3e9d7..329122fa768 100644 --- a/src/aff_expr.jl +++ b/src/aff_expr.jl @@ -311,13 +311,6 @@ end function Base.convert(::Type{GenericAffExpr{T,V}}, v::_Constant) where {T,V} return GenericAffExpr{T,V}(convert(T, _constant_to_number(v))) end -# Used in `JuMP._mul!`. -function Base.convert(::Type{T}, aff::GenericAffExpr{T}) where T - if !isempty(aff.terms) - throw(InexactError(:convert, T, aff)) - end - return convert(T, aff.constant) -end # Alias for (Float64, VariableRef), the specific GenericAffExpr used by JuMP const AffExpr = GenericAffExpr{Float64,VariableRef} diff --git a/src/quad_expr.jl b/src/quad_expr.jl index d2607673bdc..d12e6c31205 100644 --- a/src/quad_expr.jl +++ b/src/quad_expr.jl @@ -324,13 +324,6 @@ function Base.convert(::Type{GenericQuadExpr{C, V}}, v::Union{_Constant,Abstract return GenericQuadExpr(convert(GenericAffExpr{C, V}, v)) end GenericQuadExpr{C, V}() where {C, V} = zero(GenericQuadExpr{C, V}) -# Used in `JuMP._mul!`. -function Base.convert(::Type{T}, quad::GenericQuadExpr{T}) where T - if !isempty(quad.terms) - throw(InexactError(:convert, T, quad)) - end - return convert(T, quad.aff) -end function check_belongs_to_model(q::GenericQuadExpr, model::AbstractModel) check_belongs_to_model(q.aff, model)