tomo/test/optionals.tm

16 lines
229 B
Tcl

func main():
>> opt := @5?
when opt is @nonnull:
>> nonnull[]
= 5
else:
fail("Oops")
>> opt = !@Int
when opt is @nonnull:
fail("Oops")
else:
>> opt
= !Int