parent
1161482ec2
commit
b40ab4dc9e
3 changed files with 34 additions and 4 deletions
|
|
@ -775,9 +775,12 @@ proc typeSectionFinalPass(c: PContext, n: PNode) =
|
|||
if aa.kind in {nkRefTy, nkPtrTy} and aa.len == 1 and
|
||||
aa.sons[0].kind == nkObjectTy:
|
||||
# give anonymous object a dummy symbol:
|
||||
assert s.typ.sons[0].sym == nil
|
||||
s.typ.sons[0].sym = newSym(skType, getIdent(s.name.s & ":ObjectType"),
|
||||
getCurrOwner(), s.info)
|
||||
var st = s.typ
|
||||
if st.kind == tyGenericBody: st = st.lastSon
|
||||
InternalAssert st.kind in {tyPtr, tyRef}
|
||||
InternalAssert st.sons[0].sym == nil
|
||||
st.sons[0].sym = newSym(skType, getIdent(s.name.s & ":ObjectType"),
|
||||
getCurrOwner(), s.info)
|
||||
|
||||
proc SemTypeSection(c: PContext, n: PNode): PNode =
|
||||
typeSectionLeftSidePass(c, n)
|
||||
|
|
|
|||
|
|
@ -558,7 +558,7 @@ proc semObjectNode(c: PContext, n: PNode, prev: PType): PType =
|
|||
checkSonsLen(n, 3)
|
||||
if n.sons[1].kind != nkEmpty:
|
||||
base = skipTypes(semTypeNode(c, n.sons[1].sons[0], nil), skipPtrs)
|
||||
var concreteBase = skipGenericInvokation(base)
|
||||
var concreteBase = skipGenericInvokation(base).skipTypes(skipPtrs)
|
||||
if concreteBase.kind == tyObject and tfFinal notin concreteBase.flags:
|
||||
addInheritedFields(c, check, pos, concreteBase)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue