@@ -599,9 +599,19 @@ Line 1, characters 4-18:
599599Error: This value escapes its region
600600|}]
601601
602+ module M = struct
603+ let _ = local_ {contents=42}
604+ end
605+ [%%expect{|
606+ module M : sig end
607+ |}]
608+
602609let _ = local_ {contents=42}
603610[%%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
605615|}]
606616
607617
@@ -1768,21 +1778,25 @@ let foo (local_ x) y =
17681778val foo : local_ 'a option -> 'a option -> local_ 'a = <fun>
17691779|}]
17701780
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
17731785[%%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+ ^
17771789Error: This value escapes its region
17781790|}]
17791791
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
17821796[%%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+ ^
17861800Error: This value escapes its region
17871801|}]
17881802
0 commit comments