Skip to content

Commit d486463

Browse files
authored
Merge pull request #891 from JuliaOpt/bl/julia-v1.3-ambiguity
Fix method ambiguity detected by Julia v1.3
2 parents 411291b + 7712852 commit d486463

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ julia:
88
- 1.0
99
- 1.1
1010
- 1.2
11+
- 1.3
1112
notifications:
1213
email: false
1314
git:

src/Utilities/model.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,11 +474,12 @@ end
474474
# 0xd = 0x80 | 0x40 | 0x8 | 0x4 | 0x1
475475
const UPPER_BOUND_MASK = 0xcd
476476

477+
const SUPPORTED_SCALAR_SETS{T} = Union{
478+
MOI.EqualTo{T}, MOI.GreaterThan{T}, MOI.LessThan{T}, MOI.Interval{T},
479+
MOI.Integer, MOI.ZeroOne, MOI.Semicontinuous{T}, MOI.Semiinteger{T}}
477480
function MOI.supports_constraint(
478481
::AbstractModel{T}, ::Type{MOI.SingleVariable},
479-
::Type{<:Union{MOI.EqualTo{T}, MOI.GreaterThan{T}, MOI.LessThan{T},
480-
MOI.Interval{T}, MOI.Integer, MOI.ZeroOne,
481-
MOI.Semicontinuous{T}, MOI.Semiinteger{T}}}) where T
482+
::Type{<:SUPPORTED_SCALAR_SETS{T}}) where T
482483
return true
483484
end
484485
function MOI.add_constraint(model::AbstractModel{T}, f::MOI.SingleVariable,

test/Bridges/lazy_bridge_optimizer.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,8 @@ MOIU.@model(NoVariableModel,
327327
(MOI.ScalarAffineFunction,),
328328
(),
329329
(MOI.VectorAffineFunction,))
330-
function MOI.supports_constraint(::NoVariableModel, ::Type{MOI.SingleVariable},
331-
::Type{<:MOI.AbstractScalarSet})
330+
function MOI.supports_constraint(::NoVariableModel{T}, ::Type{MOI.SingleVariable},
331+
::Type{<:MOIU.SUPPORTED_SCALAR_SETS{T}}) where T
332332
return false
333333
end
334334

0 commit comments

Comments
 (0)