]> git.pld-linux.org Git - packages/libguestfs.git/blob - ocaml-4.12.patch
- started update to 1.40.2
[packages/libguestfs.git] / ocaml-4.12.patch
1 From cc4ecbe236914f9b391ecf3815008547472632f8 Mon Sep 17 00:00:00 2001
2 From: "Richard W.M. Jones" <rjones@redhat.com>
3 Date: Tue, 2 Mar 2021 10:39:15 +0000
4 Subject: [PATCH] mlstdutils/std_utils.ml: Fix for OCaml 4.12.
5
6 We were using a default function from somewhere called "compare"
7 instead of the actual function (Pervasives.compare / Stdlib.compare).
8 Since the wrong default function was used it had a different type from
9 what we expected:
10
11 File "std_utils.ml", line 312, characters 36-37:
12 312 |       | (y, y') :: _ when cmp x y = 0 -> y'
13                                           ^
14 Error: This expression has type int but an expression was expected of type
15          'weak1 list -> int
16 ---
17  mlstdutils/std_utils.ml | 2 +-
18  1 file changed, 1 insertion(+), 1 deletion(-)
19
20 diff --git a/common/mlstdutils/std_utils.ml b/common/mlstdutils/std_utils.ml
21 index 4237ea5..8847717 100644
22 --- a/common/mlstdutils/std_utils.ml
23 +++ b/common/mlstdutils/std_utils.ml
24 @@ -307,7 +307,7 @@ module List = struct
25        | x::xs, y::ys, z::zs -> (x, y, z) :: combine3 xs ys zs
26        | _ -> invalid_arg "combine3"
27  
28 -    let rec assoc_lbl ?(cmp = compare) ~default x = function
29 +    let rec assoc_lbl ?(cmp = Pervasives.compare) ~default x = function
30        | [] -> default
31        | (y, y') :: _ when cmp x y = 0 -> y'
32        | _ :: ys -> assoc_lbl ~cmp ~default x ys
This page took 0.042266 seconds and 3 git commands to generate.