summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2020-05-01 18:57:45 +0200
committerAndreas Rumpf <rumpf_a@web.de>2020-05-02 22:31:19 +0200
commit4301a7bdf06159501f8affc3e7f8de80a196cd4f (patch)
tree547edc6d6742272dda5a89cb7b55ba8081ebf842
parent7bac6f5f9af3c5c8190b81d5eded9df6b11cf5cb (diff)
downloadNim-4301a7bdf06159501f8affc3e7f8de80a196cd4f.tar.gz
fixes #14177
-rw-r--r--compiler/sempass2.nim5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim
index 0fdf25850..e1521475a 100644
--- a/compiler/sempass2.nim
+++ b/compiler/sempass2.nim
@@ -829,8 +829,9 @@ proc track(tracked: PEffects, n: PNode) =
           if op != nil:
             n[0].sym = op
 
-    for i in 0..<n.safeLen:
-      track(tracked, n[i])
+    if a.kind != nkSym or a.sym.magic != mRunnableExamples:
+      for i in 0..<n.safeLen:
+        track(tracked, n[i])
     if op != nil and op.kind == tyProc:
       for i in 1..<min(n.safeLen, op.len):
         if op[i].kind == tySink: