Skip to content

Commit

Permalink
Also load restriction from UserRestriction
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonidas-from-XIV committed Feb 2, 2022
1 parent 8a1c67a commit e93736e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/opam_solve.ml
Original file line number Diff line number Diff line change
Expand Up @@ -266,19 +266,17 @@ module Make_solver (Context : OPAM_MONOREPO_CONTEXT) :
let* pkg_name = Solver.package_name pkg in
let notes = Solver.Diagnostics.Component.notes component in
(* In the rejected candidates, try to find one where it had failed a version restriction and extract that one *)
let* version_restriction =
let* _, version_restriction =
List.find_map
~f:(function
| UserRequested restriction -> Some restriction
| Restricts (_other_role, _impl, restrictions) -> (
match restrictions with
| [] -> None
| restriction :: _ ->
let _, version_restriction =
Solver.formula restriction
in
Some version_restriction)
| restriction :: _ -> Some restriction)
| _ -> None)
notes
|> Option.map ~f:Solver.formula
in
let rejects, _reason =
Solver.Diagnostics.Component.rejects component
Expand Down

0 comments on commit e93736e

Please sign in to comment.