From 994fb12651862702b2b84b9398a384b82ee2dec4 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Wed, 21 Mar 2018 02:08:02 +0800 Subject: [PATCH] Tweak order in Map.of_list error (#645) We should show the key that came earlier in the list first --- src/stdune/map.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stdune/map.ml b/src/stdune/map.ml index 3f6b3907..329178bd 100644 --- a/src/stdune/map.ml +++ b/src/stdune/map.ml @@ -78,8 +78,8 @@ module Make(Key : Comparable.S) : S with type key = Key.t = struct | [] -> Result.Ok acc | (k, v) :: l -> match find acc k with - | None -> loop (add acc k v) l - | Some v' -> Error (k, v, v') + | None -> loop (add acc k v) l + | Some v_old -> Error (k, v_old, v) in fun l -> loop empty l