From d4c33df91996e30ded5f7f2014e7cd49176b5b05 Mon Sep 17 00:00:00 2001 From: Araq Date: Sat, 17 Dec 2016 23:02:53 +0100 Subject: [PATCH] fixes #5129 --- compiler/semstmts.nim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 0c6f6848e4..8089952667 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) =