ligo/src/test/contracts/option.ligo

14 lines
319 B
Plaintext
Raw Normal View History

// Test the option type in PascaLIGO
2020-02-27 17:51:29 +01:00
type foobar is option (int)
2019-05-12 20:56:22 +00:00
2020-02-27 17:51:29 +01:00
const s : foobar = Some (42)
2019-05-12 20:56:22 +00:00
const n : foobar = None
function assign (var m : int) : foobar is
block {
var coco : foobar := None;
2020-02-27 17:51:29 +01:00
coco := Some (m);
2019-12-04 18:30:52 +01:00
coco := (None : foobar); //temporary annotation added until type inference
} with coco