diff options
author | cooldome <cdome@bk.ru> | 2018-07-21 13:01:47 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-07-21 13:01:47 +0200 |
commit | ec0294018570c5d0542904df7b01adaf05e3ac93 (patch) | |
tree | 5429ca5360cd995bdec76070ab966761ae7ae7bf /tests/macros | |
parent | 5ea3b4d581c1997ba04ed6c7ba75623019afb95d (diff) | |
download | Nim-ec0294018570c5d0542904df7b01adaf05e3ac93.tar.gz |
Render bug: if expression with statement list expression as condition (#8375)
* Fixes #8348
Diffstat (limited to 'tests/macros')
-rw-r--r-- | tests/macros/tmacrostmt.nim | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/macros/tmacrostmt.nim b/tests/macros/tmacrostmt.nim index abb4cc050..9dbfbce43 100644 --- a/tests/macros/tmacrostmt.nim +++ b/tests/macros/tmacrostmt.nim @@ -57,5 +57,21 @@ proc test_block(x, y : int): int = result = x result = y +#------------------------------------ +# bugs #8348 + +template `>`(x, y: untyped): untyped = + ## "is greater" operator. This is the same as ``y < x``. + y < x + +proc test_cond_stmtlist(x, y: int): int = + result = x + if x > y: + result = x + + repr_and_parse(one_if_proc) repr_and_parse(test_block) +repr_and_parse(test_cond_stmtlist) + + |