make tsigbreak.nim compile

This commit is contained in:
Andreas Rumpf 2016-12-12 14:08:01 +01:00
commit e169eaac5b
5 changed files with 42 additions and 7 deletions

View file

@ -122,7 +122,6 @@ type
ConsiderFlag* = enum
CoProc
CoType
CoNoGeneric
proc hashType(c: var MD5Context, t: PType; flags: set[ConsiderFlag]) =
if t == nil:
@ -153,10 +152,10 @@ proc hashType(c: var MD5Context, t: PType; flags: set[ConsiderFlag]) =
if t.sym != nil and {sfImportc, sfExportc} * t.sym.flags != {}:
c.hashSym(t.sym)
of tyObject, tyEnum:
if t.typeInst != nil and CoNoGeneric notin flags:
if t.typeInst != nil:
assert t.typeInst.kind == tyGenericInst
for i in countup(1, sonsLen(t.typeInst) - 2):
c.hashType t.typeInst.sons[i], flags+{CoNoGeneric}
c.hashType t.typeInst.sons[i], flags
# Every cyclic type in Nim need to be constructed via some 't.sym', so this
# is actually safe without an infinite recursion check:
if t.sym != nil: