summary refs log tree commit diff stats
path: root/compiler/semtempl.nim
diff options
context:
space:
mode:
authorSteve Kellock <steve@kellock.ca>2018-10-09 14:14:54 -0400
committerAndreas Rumpf <rumpf_a@web.de>2018-10-09 20:14:54 +0200
commit173e8c49134c04c13870192884f6c1bf00cbe7e5 (patch)
tree0c08363c8e176b22c099457c5902303a2cd5e5b0 /compiler/semtempl.nim
parent33458894da13da7134604639c129273bfb0cb1c1 (diff)
downloadNim-173e8c49134c04c13870192884f6c1bf00cbe7e5.tar.gz
fixes unexpected transforming of runnableExamples (#9158)
Diffstat (limited to 'compiler/semtempl.nim')
-rw-r--r--compiler/semtempl.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim
index 396696422..484a7ddd6 100644
--- a/compiler/semtempl.nim
+++ b/compiler/semtempl.nim
@@ -493,7 +493,9 @@ proc semTemplBody(c: var TemplCtx, n: PNode): PNode =
     else:
       result = semTemplBodySons(c, n)
   of nkCallKinds-{nkPostfix}:
-    result = semTemplBodySons(c, n)
+    # do not transform runnableExamples (bug #9143)
+    if not isRunnableExamples(n[0]):
+      result = semTemplBodySons(c, n)
   of nkDotExpr, nkAccQuoted:
     # dotExpr is ambiguous: note that we explicitly allow 'x.TemplateParam',
     # so we use the generic code for nkDotExpr too