diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-05-28 22:40:28 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2016-05-28 22:40:28 +0200 |
commit | e65c89ee28a8b03e00f5dba9ff181918764d72c0 (patch) | |
tree | 5f01f713d85dd8f502e7873248782b30c3fb9bfb /compiler/seminst.nim | |
parent | ab08ee1ce63a0f8f48026aeeaf07a8a9236ca17e (diff) | |
download | Nim-e65c89ee28a8b03e00f5dba9ff181918764d72c0.tar.gz |
fixes #4177
Diffstat (limited to 'compiler/seminst.nim')
-rw-r--r-- | compiler/seminst.nim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/seminst.nim b/compiler/seminst.nim index 14631a590..e4ac56cd6 100644 --- a/compiler/seminst.nim +++ b/compiler/seminst.nim @@ -43,9 +43,11 @@ proc rawHandleSelf(c: PContext; owner: PSym) = if arg.name.id == c.selfName.id: c.p.selfSym = arg arg.flags.incl sfIsSelf - let t = c.p.selfSym.typ.skipTypes(abstractPtrs) - if t.kind == tyObject: + var t = c.p.selfSym.typ.skipTypes(abstractPtrs) + while t.kind == tyObject: addObjFieldsToLocalScope(c, t.n) + if t.sons[0] == nil: break + t = t.sons[0].skipTypes(abstractPtrs) proc pushProcCon*(c: PContext; owner: PSym) = rawPushProcCon(c, owner) |