tomo/test/optionals.tm

16 lines
229 B
Plaintext
Raw Normal View History

2024-07-01 09:30:22 -07:00
func main():
>> opt := @5?
when opt is @nonnull:
>> nonnull[]
= 5
else:
fail("Oops")
>> opt = !@Int
when opt is @nonnull:
fail("Oops")
else:
>> opt
= !Int