diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-11-17 18:19:06 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-11-18 14:18:00 +0100 |
commit | 5b57abe3544261ba2df29648d48a997e8d1983da (patch) | |
tree | b85e6b1dacce76b6cc975b2a58234b8d6aec743d /tests | |
parent | 6976bf20f5f0ca97ab0e659ccd1e97be222b7ca1 (diff) | |
download | Nim-5b57abe3544261ba2df29648d48a997e8d1983da.tar.gz |
closes #6166
Diffstat (limited to 'tests')
-rw-r--r-- | tests/exprs/tstmtexprs.nim | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/exprs/tstmtexprs.nim b/tests/exprs/tstmtexprs.nim index b2d5db408..01f429b07 100644 --- a/tests/exprs/tstmtexprs.nim +++ b/tests/exprs/tstmtexprs.nim @@ -5,7 +5,8 @@ discard """ 6 abcdefghijklmnopqrstuvwxyz 145 23 -3''' +3 +2''' """ import strutils @@ -122,3 +123,21 @@ var testTry = PFooBase(field: 5) echo(testTry.field) + +# bug #6166 + +proc quo(op: proc (x: int): bool): int = + result = + if op(3): + 2 + else: + 0 + +echo( + if true: + quo do (a: int) -> bool: + a mod 2 != 0 + else: + quo do (a: int) -> bool: + a mod 3 != 0 +) \ No newline at end of file |