From 325b367a1342826fe7174ce45cfab92091d4dbb5 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 21 Dec 2024 15:13:26 -0500 Subject: Support logical binary operators on optionals (promote to booleans) --- test/optionals.tm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/optionals.tm b/test/optionals.tm index 2ccdf392..5aefedf4 100644 --- a/test/optionals.tm +++ b/test/optionals.tm @@ -326,3 +326,8 @@ func main(): >> [Struct(5,"A")?, Struct(6,"B"), Struct(7,"C")] = [Struct(x=5, y="A"), Struct(x=6, y="B"), Struct(x=7, y="C")] + + if 5? or no: + say("Binary op 'or' works with optionals") + else: + fail("Failed to do binary op 'or' on optional") -- cgit v1.2.3