diff options
author | Araq <rumpf_a@web.de> | 2012-09-21 22:07:26 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-09-21 22:07:26 +0200 |
commit | 4577751bad1a2421921eb8c9bf40a4961daceb78 (patch) | |
tree | 6f56441e19de4c9d483292cccdd0727b25824b22 /compiler | |
parent | be1a709e7e0692fb8183cad4727529a41613eb06 (diff) | |
download | Nim-4577751bad1a2421921eb8c9bf40a4961daceb78.tar.gz |
bugfix: code generator can deal with ftpclient.nim
Diffstat (limited to 'compiler')
-rwxr-xr-x | compiler/ccgtypes.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim index 7a254e867..88c589a0c 100755 --- a/compiler/ccgtypes.nim +++ b/compiler/ccgtypes.nim @@ -721,6 +721,10 @@ proc genTypeInfoAux(m: BModule, typ: PType, name: PRope) = genTypeInfoAuxBase(m, typ, name, base) proc discriminatorTableName(m: BModule, objtype: PType, d: PSym): PRope = + # bugfix: we need to search the type that contains the discriminator: + var objtype = objtype + while lookupInRecord(objtype.n, d.name) == nil: + objtype = objtype.sons[0] if objType.sym == nil: InternalError(d.info, "anonymous obj with discriminator") result = ropef("NimDT_$1_$2", [ |