Skip to content

Commit 9438a8b

Browse files
authored
Merge pull request #315 from JuliaOpt/bl/v0.7warn
Remove v0.7 warnings
2 parents 6a4da6c + 0699b89 commit 9438a8b

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/Utilities/functions.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ If `x` (resp. `y`, `z`) is `VariableIndex(1)` (resp. 2, 3).
140140
The canonical representation of `ScalarAffineFunction([y, x, z, x, z], [2, 1, 3, -2, -3], 5)` is `ScalarAffineFunction([x, y], [-1, 2], 5)`.
141141
142142
"""
143-
function canonical{T}(f::SAF{T})
143+
function canonical(f::SAF{T}) where T
144144
σ = sortperm(f.variables)
145145
outputindex = Int[]
146146
variables = VI[]
@@ -165,7 +165,7 @@ function canonical{T}(f::SAF{T})
165165
end
166166
SAF{T}(variables, coefficients, f.constant)
167167
end
168-
function canonical{T}(f::VAF{T})
168+
function canonical(f::VAF{T}) where T
169169
σ = sortperm(1:length(f.variables), by = i -> (f.outputindex[i], f.variables[i]))
170170
outputindex = Int[]
171171
variables = VI[]

src/Utilities/model.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ function _getset(constrs::Vector, ci::CI, i::Int)
3030
_gets(constrs[i]...)
3131
end
3232

33-
_modifyconstr{F, S}(ci::CI{F, S}, f::F, s::S, change::F) = (ci, change, s)
34-
_modifyconstr{F, S}(ci::CI{F, S}, f::F, s::S, change::S) = (ci, f, change)
35-
_modifyconstr{F, S}(ci::CI{F, S}, f::F, s::S, change::MOI.AbstractFunctionModification) = (ci, modifyfunction(f, change), s)
36-
function _modifyconstraint!{F, S}(constrs::Vector{C{F, S}}, ci::CI{F}, i::Int, change)
33+
_modifyconstr(ci::CI{F, S}, f::F, s::S, change::F) where {F, S} = (ci, change, s)
34+
_modifyconstr(ci::CI{F, S}, f::F, s::S, change::S) where {F, S} = (ci, f, change)
35+
_modifyconstr(ci::CI{F, S}, f::F, s::S, change::MOI.AbstractFunctionModification) where {F, S} = (ci, modifyfunction(f, change), s)
36+
function _modifyconstraint!(constrs::Vector{C{F, S}}, ci::CI{F}, i::Int, change) where {F, S}
3737
constrs[i] = _modifyconstr(constrs[i]..., change)
3838
end
3939

40-
_getnoc{F, S}(constrs::Vector{C{F, S}}, noc::MOI.NumberOfConstraints{F, S}) = length(constrs)
40+
_getnoc(constrs::Vector{C{F, S}}, noc::MOI.NumberOfConstraints{F, S}) where {F, S} = length(constrs)
4141
# Might be called when calling NumberOfConstraint with different coefficient type than the one supported
4242
_getnoc(constrs::Vector, noc::MOI.NumberOfConstraints) = 0
4343

44-
function _getloc{F, S}(constrs::Vector{C{F, S}})::Vector{Tuple{DataType, DataType}}
44+
function _getloc(constrs::Vector{C{F, S}})::Vector{Tuple{DataType, DataType}} where {F, S}
4545
isempty(constrs) ? [] : [(F, S)]
4646
end
4747

@@ -534,7 +534,7 @@ macro model(modelname, ss, sst, vs, vst, sf, sft, vf, vft)
534534
field = _field(s)
535535
code = quote
536536
$code
537-
$funct{F}(model::$c, ci::$T{F, <:$set}, args...) = $funct(model.$field, ci, args...)
537+
$funct(model::$c, ci::$T{F, <:$set}, args...) where F = $funct(model.$field, ci, args...)
538538
end
539539
end
540540
end

src/Utilities/sets.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ const DimensionUpdatableSets = Union{MOI.Reals,
1616
1717
Returns a set with the dimension modified to `newdim`.
1818
"""
19-
function updatedimension{S<:DimensionUpdatableSets}(::S, newdim)
19+
function updatedimension(::S, newdim) where S<:DimensionUpdatableSets
2020
S(newdim)
2121
end

0 commit comments

Comments
 (0)