Skip to content

Commit d5c3567

Browse files
authored
Alternative fix for #2161 (#2163)
1 parent a0f221e commit d5c3567

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

src/Utilities/universalfallback.jl

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -636,45 +636,27 @@ end
636636
check_type_and_multiple_names(::Type, ::Nothing, ::Nothing, name) = nothing
637637

638638
function check_type_and_multiple_names(
639-
::Type{T},
639+
# >: Needed for MathOptInterface.jl#2159.
640+
::Type{>:T},
640641
value::T,
641642
::Nothing,
642643
name,
643644
) where {T}
644645
return value
645646
end
646647

647-
# Needed for https://github.com/jump-dev/MathOptInterface.jl/issues/2159.
648-
function check_type_and_multiple_names(
649-
::Type{MOI.ConstraintIndex},
650-
value::MOI.ConstraintIndex{F,S},
651-
::Nothing,
652-
name,
653-
) where {F,S}
654-
return value
655-
end
656-
657648
check_type_and_multiple_names(::Type, ::Any, ::Nothing, name) = nothing
658649

659650
function check_type_and_multiple_names(
660-
::Type{T},
651+
# >: Needed for MathOptInterface.jl#2159.
652+
::Type{>:T},
661653
::Nothing,
662654
value::T,
663655
name,
664656
) where {T}
665657
return value
666658
end
667659

668-
# Needed for https://github.com/jump-dev/MathOptInterface.jl/issues/2159.
669-
function check_type_and_multiple_names(
670-
::Type{MOI.ConstraintIndex},
671-
::Nothing,
672-
value::MOI.ConstraintIndex,
673-
name,
674-
)
675-
return value
676-
end
677-
678660
check_type_and_multiple_names(::Type, ::Nothing, ::Any, name) = nothing
679661

680662
function check_type_and_multiple_names(T::Type, ::Any, ::Any, name)

0 commit comments

Comments
 (0)