From fb37b0ee4253651cab10b41cc2e1f536b17b26d4 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 15 Sep 2024 16:29:45 -0400 Subject: Fix up `if var := ...:` in ternary expressions and optional checking logic --- test/optionals.tm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'test/optionals.tm') diff --git a/test/optionals.tm b/test/optionals.tm index 6d7db835..ced42274 100644 --- a/test/optionals.tm +++ b/test/optionals.tm @@ -284,3 +284,31 @@ func main(): = {!Int} >> [5?, !Int, !Int, 6?]:sorted() = [!Int, !Int, 5?, 6?] + + do: + >> value := if var := 5?: + var + else: + 0 + = 5 + + do: + >> value := if var := !Int: + var + else: + 0 + = 0 + + do: + >> opt := 5? + >> if opt: + >> opt + else: + >> opt + + do: + >> opt := !Int + >> if opt: + >> opt + else: + >> opt -- cgit v1.2.3