From 1efb5174f26caeebafe1b5ea9487690c5ffe1adb Mon Sep 17 00:00:00 2001 From: Araq Date: Mon, 9 Mar 2015 15:02:28 +0100 Subject: fixes #2220; #2219; breaks #2022; for #2022 callsite needs to be used --- tests/generics/tunique_type.nim | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/generics') 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", -- cgit 1.4.1-2-gfad0