summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2016-12-17 23:02:53 +0100
committerAraq <rumpf_a@web.de>2016-12-17 23:02:53 +0100
commitd4c33df91996e30ded5f7f2014e7cd49176b5b05 (patch)
treef0e482a3f8a650202c22b80ee23a62e9aac88dbb /compiler
parent9ac76b49c0f5f13b7f4095fc436aabbb7385be30 (diff)
downloadNim-d4c33df91996e30ded5f7f2014e7cd49176b5b05.tar.gz
fixes #5129
Diffstat (limited to 'compiler')
-rw-r--r--compiler/semstmts.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 0c6f6848e..808995266 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -759,8 +759,10 @@ proc typeSectionRightSidePass(c: PContext, n: PNode) =
       if st.kind == tyGenericBody: st = st.lastSon
       internalAssert st.kind in {tyPtr, tyRef}
       internalAssert st.lastSon.sym == nil
-      st.lastSon.sym = newSym(skType, getIdent(s.name.s & ":ObjectType"),
+      let obj = newSym(skType, getIdent(s.name.s & ":ObjectType"),
                               getCurrOwner(), s.info)
+      obj.typ = st.lastSon
+      st.lastSon.sym = obj
 
 proc checkForMetaFields(n: PNode) =
   template checkMeta(t) =