summary refs log tree commit diff stats
path: root/tests/exprs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/exprs')
-rw-r--r--tests/exprs/tstmtexprs.nim21
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