@@ -599,9 +599,19 @@ Line 1, characters 4-18:
599
599
Error: This value escapes its region
600
600
|}]
601
601
602
+ module M = struct
603
+ let _ = local_ {contents=42}
604
+ end
605
+ [%%expect{|
606
+ module M : sig end
607
+ |}]
608
+
602
609
let _ = local_ {contents=42}
603
610
[%%expect{|
604
- - : int ref = {contents = 42}
611
+ Line 1, characters 4-5:
612
+ 1 | let _ = local_ {contents=42}
613
+ ^
614
+ Error: This value escapes its region
605
615
|}]
606
616
607
617
@@ -1768,21 +1778,25 @@ let foo (local_ x) y =
1768
1778
val foo : local_ 'a option -> 'a option -> local_ 'a = <fun>
1769
1779
|}]
1770
1780
1771
- let (Some z, _, _) | (None, Some z, _)
1772
- | (None, None, z) = (Some (ref 0), (local_ (Some (ref 0))), (ref 0))
1781
+ module M = struct
1782
+ let (Some z, _, _) | (None, Some z, _)
1783
+ | (None, None, z) = (Some (ref 0), (local_ (Some (ref 0))), (ref 0))
1784
+ end
1773
1785
[%%expect{|
1774
- Line 1 , characters 33-34 :
1775
- 1 | let (Some z, _, _) | (None, Some z, _)
1776
- ^
1786
+ Line 2 , characters 35-36 :
1787
+ 2 | let (Some z, _, _) | (None, Some z, _)
1788
+ ^
1777
1789
Error: This value escapes its region
1778
1790
|}]
1779
1791
1780
- let (Some z, _, _) | (None, Some z, _)
1781
- | (None, None, z) = ((local_ Some (ref 0)), (Some (ref 0)), (ref 0))
1792
+ module M = struct
1793
+ let (Some z, _, _) | (None, Some z, _)
1794
+ | (None, None, z) = ((local_ Some (ref 0)), (Some (ref 0)), (ref 0))
1795
+ end
1782
1796
[%%expect{|
1783
- Line 1 , characters 10-11 :
1784
- 1 | let (Some z, _, _) | (None, Some z, _)
1785
- ^
1797
+ Line 2 , characters 12-13 :
1798
+ 2 | let (Some z, _, _) | (None, Some z, _)
1799
+ ^
1786
1800
Error: This value escapes its region
1787
1801
|}]
1788
1802
0 commit comments