summary refs log tree commit diff stats
path: root/compiler/semstmts.nim
diff options
context:
space:
mode:
authorLemonBoy <LemonBoy@users.noreply.github.com>2018-09-11 20:32:25 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-09-11 20:32:25 +0200
commit8670f4911b742c87210b97150197080310b5ab58 (patch)
tree567e23f6feaa9ec93bfac7d7594bc9eb65487d79 /compiler/semstmts.nim
parente7d404340628ef2ca6170744a7df33e20cd0fc1a (diff)
downloadNim-8670f4911b742c87210b97150197080310b5ab58.tar.gz
Fix semantic pass with borrowed magic procs (#8945)
Reported by pqflx3 on the forum.
Diffstat (limited to 'compiler/semstmts.nim')
-rw-r--r--compiler/semstmts.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index fb01127fc..c2392ec8c 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -1173,6 +1173,9 @@ proc semBorrow(c: PContext, n: PNode, s: PSym) =
   if b != nil:
     # store the alias:
     n.sons[bodyPos] = newSymNode(b)
+    # Carry over the original symbol magic, this is necessary in order to ensure
+    # the semantic pass is correct
+    s.magic = b.magic
   else:
     localError(c.config, n.info, errNoSymbolToBorrowFromFound)