File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
testsuite/tests/typing-local Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -200,3 +200,15 @@ val f : unit -> local_ unit = <fun>
200
200
- : unit = ()
201
201
|}]
202
202
203
+ (* exclave means the inner body must be exactly at local; cannot be global *)
204
+ let f () =
205
+ exclave_ (
206
+ (fun x y -> () ) : (string -> string -> unit )
207
+ )
208
+ [%% expect{|
209
+ Line 3 , characters 4-19 :
210
+ 3 | (fun x y -> () ) : (string -> string -> unit )
211
+ ^^^^^^^^^^^^^^^
212
+ Error : This function or one of its parameters escape their region
213
+ when it is partially applied
214
+ | }]
Original file line number Diff line number Diff line change @@ -4454,7 +4454,7 @@ and type_expect_
4454
4454
| RTail (mode , _ ) ->
4455
4455
(* mode' is RNontail, because currently our language cannot construct
4456
4456
region in the tail of another region.*)
4457
- let mode' = mode_default mode in
4457
+ let mode' = mode_exact mode in
4458
4458
(* The middle-end relies on all functions which allocate into their
4459
4459
parent's region having a return mode of local. *)
4460
4460
submode ~loc ~env ~reason: Other Value_mode. local mode';
You can’t perform that action at this time.
0 commit comments