ligo/src/test/contracts/closure.mligo
2019-11-21 06:02:47 -08:00

10 lines
251 B
Plaintext

(* Test whether closures retain values in CameLIGO *)
let test (k: int) : int =
let j: int = k + 5 in
let close: (int -> int) =
fun (i: int) -> i + j
in
let j: int = 20 in (* Shadow original variable to see if value close'd *)
close 20