From ee17bfc0ce426cbcdf4a1f8f424a256d143434fc Mon Sep 17 00:00:00 2001 From: Mark Shinwell Date: Wed, 28 Oct 2015 13:58:30 +0000 Subject: [PATCH 1/2] look at all labels when determining mutability of a record resulting from 'with' --- bytecomp/translcore.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bytecomp/translcore.ml b/bytecomp/translcore.ml index 0d2721d2c..935352a85 100644 --- a/bytecomp/translcore.ml +++ b/bytecomp/translcore.ml @@ -1170,7 +1170,7 @@ and transl_record env all_labels repres lbl_expr_list opt_init_expr = lbl_expr_list; let ll = Array.to_list lv in let mut = - if List.exists (fun (_, lbl, expr) -> lbl.lbl_mut = Mutable) lbl_expr_list + if List.exists (fun lbl -> lbl.lbl_mut = Mutable) all_labels then Mutable else Immutable in let lam = From f923aa767b7a010c7418715137125e60a30a39a7 Mon Sep 17 00:00:00 2001 From: Mark Shinwell Date: Wed, 28 Oct 2015 14:15:11 +0000 Subject: [PATCH 2/2] push the correct patch --- bytecomp/translcore.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bytecomp/translcore.ml b/bytecomp/translcore.ml index 935352a85..bf810f32f 100644 --- a/bytecomp/translcore.ml +++ b/bytecomp/translcore.ml @@ -1170,7 +1170,8 @@ and transl_record env all_labels repres lbl_expr_list opt_init_expr = lbl_expr_list; let ll = Array.to_list lv in let mut = - if List.exists (fun lbl -> lbl.lbl_mut = Mutable) all_labels + if List.exists (fun lbl -> lbl.lbl_mut = Mutable) + (Array.to_list all_labels) then Mutable else Immutable in let lam =