summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorcooldome <ariabushenko@gmail.com>2020-11-24 14:49:14 +0000
committerGitHub <noreply@github.com>2020-11-24 15:49:14 +0100
commit1d14b2c9e61c5e9389f8b52839814156dcf259dd (patch)
treee2f8533b430720ddcf7e92d9c6915c65edc658b2 /compiler
parentafb8b69c0a61fbc821cd3ce014c017a3523bd3d2 (diff)
downloadNim-1d14b2c9e61c5e9389f8b52839814156dcf259dd.tar.gz
fix #16110 (#16117)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semstmts.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index cd7428b62..713867b76 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -1278,7 +1278,8 @@ proc typeSectionRightSidePass(c: PContext, n: PNode) =
       incl st.flags, tfRefsAnonObj
       let obj = newSym(skType, getIdent(c.cache, s.name.s & ":ObjectType"),
                        nextId c.idgen, getCurrOwner(c), s.info)
-      obj.ast = a
+      obj.ast = a.copyTree
+      obj.ast[0] = newSymNode(obj)
       if sfPure in s.flags:
         obj.flags.incl sfPure
       obj.typ = st.lastSon