Skip to content

Commit 8c5a2ab

Browse files
committed
🐛 Fix method ambiguity #147
1 parent 5862f99 commit 8c5a2ab

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/default.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,11 @@ end
100100
solver(v::VRepresentation, solver::Union{Nothing, MPB.AbstractMathProgSolver}=default_solver(v)) = VRepSolver()
101101
solver(h::HRepresentation, solver::Union{Nothing, MPB.AbstractMathProgSolver}=default_solver(h)) = solver
102102

103-
_promote_reptype(P1::Type{<:HRep}, ::Type{<:HRep}) = P1
104-
_promote_reptype(P1::Type{<:VRep}, ::Type{<:VRep}) = P1
103+
_promote_reptype(P::Type{<:HRep}, ::Type{<:HRep}) = P
104+
_promote_reptype(P::Type{<:VRep}, ::Type{<:VRep}) = P
105+
# Breaks ambiguity with above two methods
106+
_promote_reptype(P::Type{<:Polyhedron}, ::Type{<:Polyhedron}) = P
107+
105108
function promote_reptype(P1::Type{<:Rep}, P2::Type{<:Rep})
106109
_promote_reptype(P1, P2)
107110
end

0 commit comments

Comments
 (0)