2019-09-22 01:59:48 +04:00
|
|
|
// Test the option type in PascaLIGO
|
|
|
|
|
2019-05-13 00:56:22 +04:00
|
|
|
type foobar is option(int)
|
|
|
|
|
|
|
|
const s : foobar = Some(42)
|
|
|
|
const n : foobar = None
|
2019-10-07 13:54:27 +04:00
|
|
|
|
|
|
|
function assign (var m : int) : foobar is
|
|
|
|
var coco : foobar := None;
|
|
|
|
block
|
|
|
|
{
|
|
|
|
coco := Some(m);
|
|
|
|
coco := None;
|
|
|
|
}
|
|
|
|
with coco
|