diff --git a/src/JuMP.jl b/src/JuMP.jl index 9bc01c96cad..659709c6b41 100644 --- a/src/JuMP.jl +++ b/src/JuMP.jl @@ -1049,6 +1049,9 @@ function owner_model end Base.ndims(::Type{<:AbstractJuMPScalar}) = 0 Base.ndims(::AbstractJuMPScalar) = 0 +Base.IteratorEltype(::Type{<:AbstractJuMPScalar}) = Base.HasEltype() +Base.eltype(::Type{T}) where {T<:AbstractJuMPScalar} = T + # These are required to create symmetric containers of AbstractJuMPScalars. LinearAlgebra.symmetric_type(::Type{T}) where {T<:AbstractJuMPScalar} = T LinearAlgebra.hermitian_type(::Type{T}) where {T<:AbstractJuMPScalar} = T