Skip to content

Commit

Permalink
refactor: Use [conflict_class] in simplified rep (#11369)
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <[email protected]>
  • Loading branch information
rgrinberg authored Jan 21, 2025
1 parent 1ccb583 commit 252dbe9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/dune_pkg/opam_solver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ module Solver = struct

and real_impl =
{ pkg : OpamPackage.t
; opam : OpamFile.OPAM.t
; conflict_class : OpamPackage.Name.t list
; requires : dependency list
}

Expand Down Expand Up @@ -414,7 +414,7 @@ module Solver = struct
;;

let conflict_class = function
| RealImpl impl -> OpamFile.OPAM.conflict_class impl.opam
| RealImpl impl -> impl.conflict_class
| VirtualImpl _ -> []
| Dummy | Reject _ -> []
;;
Expand Down Expand Up @@ -536,7 +536,8 @@ module Solver = struct
make_deps Ensure ensure OpamFile.OPAM.depends
@ make_deps Prevent prevent OpamFile.OPAM.conflicts
in
Some (RealImpl { pkg; opam; requires }))
let conflict_class = OpamFile.OPAM.conflict_class opam in
Some (RealImpl { pkg; requires; conflict_class }))
;;

let meets_restriction impl { Restriction.kind; expr } =
Expand Down

0 comments on commit 252dbe9

Please sign in to comment.