summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2019-05-05 12:20:33 +0200
committerAraq <rumpf_a@web.de>2019-05-05 12:20:43 +0200
commit094d71cb6f6fbdedfd43a2bc6c66b227aedf1ddf (patch)
tree16592b865123ec65138b23ae90b210a87d3fd620 /compiler
parenta60305fbf3897cd90680e693dd4c0db2334d85d4 (diff)
downloadNim-094d71cb6f6fbdedfd43a2bc6c66b227aedf1ddf.tar.gz
fixes #11175
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semexprs.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim
index 0d81cab37..cb52724b9 100644
--- a/compiler/semexprs.nim
+++ b/compiler/semexprs.nim
@@ -1927,7 +1927,9 @@ proc processQuotations(c: PContext; n: var PNode, op: string,
     processQuotations(c, n.sons[i], op, quotes, ids)
 
 proc semQuoteAst(c: PContext, n: PNode): PNode =
-  internalAssert c.config, n.len == 2 or n.len == 3
+  if n.len != 2 and n.len != 3:
+    localError(c.config, n.info, "'quote' expects 1 or 2 arguments")
+    return n
   # We transform the do block into a template with a param for
   # each interpolation. We'll pass this template to getAst.
   var