ligo/src/test/contracts/option.ligo

14 lines
316 B
Plaintext
Raw Normal View History

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