summary refs log tree commit diff stats
path: root/tests/generics
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-03-09 15:02:28 +0100
committerAraq <rumpf_a@web.de>2015-03-10 12:32:46 +0100
commit1efb5174f26caeebafe1b5ea9487690c5ffe1adb (patch)
tree90b292c6f6b2c45b24b26b9202fc9e13d0035298 /tests/generics
parent3ea3aa633d92e9a9c3f4668727c194cfae3ce7c4 (diff)
downloadNim-1efb5174f26caeebafe1b5ea9487690c5ffe1adb.tar.gz
fixes #2220; #2219; breaks #2022; for #2022 callsite needs to be used
Diffstat (limited to 'tests/generics')
-rw-r--r--tests/generics/tunique_type.nim7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/generics/tunique_type.nim b/tests/generics/tunique_type.nim
index f8901d3bd..29367181c 100644
--- a/tests/generics/tunique_type.nim
+++ b/tests/generics/tunique_type.nim
@@ -1,5 +1,11 @@
 # Bug #2022
 
+discard """
+  output: '''@[97, 45]
+@[true, false]
+@[false, false]'''
+"""
+
 ## The goal of this snippet is to provide and test a construct for general-
 ## purpose, random-access mapping. I use an AST-manipulation-based approach
 ## because it's more efficient than using procedure pointers and less
@@ -31,6 +37,7 @@ type Mapped[Input; predicate: static[string]] = object
   input: Input
 
 macro map(input, predicate: expr): expr =
+  let predicate = callsite()[2]
   newNimNode(nnkObjConstr).add(
     newNimNode(nnkBracketExpr).add(
       ident"Mapped",