diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-09-15 16:29:45 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-09-15 16:29:45 -0400 |
| commit | fb37b0ee4253651cab10b41cc2e1f536b17b26d4 (patch) | |
| tree | 30942d2d3d8f5781fffcc0d35733b698bbd43b14 /test | |
| parent | 2b454d1408846fe8ea31c3dce1551d8ebffa8d0d (diff) | |
Fix up `if var := ...:` in ternary expressions and optional checking
logic
Diffstat (limited to 'test')
| -rw-r--r-- | test/optionals.tm | 28 |
1 files changed, 28 insertions, 0 deletions
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 |
