Skip to content

Commit

Permalink
Error message if conditions are broken
Browse files Browse the repository at this point in the history
  • Loading branch information
dlesbre committed May 10, 2024
1 parent 2645021 commit cb16f86
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions patriciaTree.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,8 @@ module MakeCustomHeterogeneous
| Eq ->
if value == valueb then (acc,true)
else (f.f key (Some value) (Some valueb) acc,true)
| Diff -> assert false (* Same id should be equal. *)
| Diff ->
raise (Invalid_argument "Keys with same to_int value are not equal by polyeq")
in
let (acc,found) = fold{f=fun keyb valueb acc -> g keyb valueb acc} tb (acc,false) in
if found then acc
Expand All @@ -1272,7 +1273,8 @@ module MakeCustomHeterogeneous
| Eq ->
if valuea == value then (acc,true)
else (f.f keya (Some valuea) (Some value) acc,true)
| Diff -> assert false
| Diff ->
raise (Invalid_argument "Keys with same to_int value are not equal by polyeq")
in
let (acc,found) = fold{f=fun keya valuea acc -> g keya valuea acc} ta (acc,false) in
if found then acc
Expand Down

0 comments on commit cb16f86

Please sign in to comment.