From a728e95541783e63f8e1f3cc151882c41edc886c Mon Sep 17 00:00:00 2001 From: "femtocleaner[bot]" Date: Sat, 9 Jun 2018 01:12:45 +0000 Subject: [PATCH] Fix deprecations --- src/JuMPContainer.jl | 4 ++-- src/norms.jl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/JuMPContainer.jl b/src/JuMPContainer.jl index 77dfede9f44..061951e1625 100644 --- a/src/JuMPContainer.jl +++ b/src/JuMPContainer.jl @@ -19,7 +19,7 @@ mutable struct JuMPDict{T,N} <: JuMPContainer{T,N} tupledict::Dict{NTuple{N,Any},T} meta::Dict{Symbol,Any} - (::Type{JuMPDict{T,N}}){T,N}() = new{T,N}(Dict{NTuple{N,Any},T}(), Dict{Symbol,Any}()) + JuMPDict{T,N}() where {T,N} = new{T,N}(Dict{NTuple{N,Any},T}(), Dict{Symbol,Any}()) end function JuMPDict(d::Dict{NTuple{N,Any},T}) where {T,N} @@ -211,7 +211,7 @@ mutable struct KeyIterator{JA<:JuMPArray} x::JA dim::Int next_k_cache::Array{Any,1} - function (::Type{KeyIterator{JA}}){JA}(d) + function KeyIterator{JA}(d) where JA n = ndims(d.innerArray) new{JA}(d, n, Array{Any}(n+1)) end diff --git a/src/norms.jl b/src/norms.jl index 86f6c29b247..86048fd1b12 100644 --- a/src/norms.jl +++ b/src/norms.jl @@ -108,7 +108,7 @@ getvalue(n::GenericNormExpr) = n.coeff * getvalue(n.norm) + getvalue(n.aff) # α||Ax-b||₂ + cᵀx + d ≤ 0 mutable struct GenericSOCConstraint{T<:GenericSOCExpr} <: AbstractConstraint normexpr::T - function (::Type{GenericSOCConstraint{T}}){T}(normexpr::T) + function GenericSOCConstraint{T}(normexpr::T) where T if normexpr.coeff < 0 # The coefficient in front of the norm is negative, which # means we have `norm >= c`, which is not convex.