This commit is contained in:
swrup 2025-11-11 02:07:51 +01:00
parent aa2ff7b2f0
commit 2f3113f55d
11742 changed files with 1223940 additions and 0 deletions

View file

@ -0,0 +1,24 @@
open! Base
(* first test that we only allow global elements *)
let local_id (local_ x) = x;;
let k = local_id 42 in
Array.create_local ~len:10 k
[%%expect
{|
Line _, characters _-_:
Error: This value escapes its region
|}]
;;
(* then check that the array is indeed local *)
let arr = Array.create_local ~len:10 42 in
ref arr
[%%expect
{|
Line _, characters _-_:
Error: This value escapes its region
|}]