This commit is contained in:
parent
aa2ff7b2f0
commit
2f3113f55d
11742 changed files with 1223940 additions and 0 deletions
24
unikernel/duniverse/base/test/test_array_local.mlt
Normal file
24
unikernel/duniverse/base/test/test_array_local.mlt
Normal 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
|
||||
|}]
|
||||
Loading…
Add table
Add a link
Reference in a new issue