summary refs log tree commit diff stats
path: root/tests/compile/compilehelpers.nim
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2014-01-04 12:28:25 +0200
committerZahary Karadjov <zahary@gmail.com>2014-01-04 13:10:52 +0200
commit789ba107cf3bcc1a87d896fc7cbfa11e151898c2 (patch)
treea912096f7e5133f3dd08528d1499d6cd1ecec305 /tests/compile/compilehelpers.nim
parent02533c260b16ce7b16a47781d104b46b36544749 (diff)
downloadNim-789ba107cf3bcc1a87d896fc7cbfa11e151898c2.tar.gz
introduce tyFromExpr; fixes #618
Diffstat (limited to 'tests/compile/compilehelpers.nim')
-rw-r--r--tests/compile/compilehelpers.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/compile/compilehelpers.nim b/tests/compile/compilehelpers.nim
new file mode 100644
index 000000000..cb26ca5b5
--- /dev/null
+++ b/tests/compile/compilehelpers.nim
@@ -0,0 +1,6 @@
+template accept(e: expr) =
+  static: assert(compiles(e))
+
+template reject(e: expr) =
+  static: assert(not compiles(e))
+