diff --git a/compiler/ast.nim b/compiler/ast.nim index 0e4700065d..65806ea1f2 100755 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -675,7 +675,6 @@ type size*: BiggestInt # the size of the type in bytes # -1 means that the size is unkwown align*: int # the type's alignment requirements - containerID*: int # used for type checking of generics loc*: TLoc TPair*{.final.} = object @@ -1012,7 +1011,6 @@ proc assignType(dest, src: PType) = dest.n = src.n dest.size = src.size dest.align = src.align - dest.containerID = src.containerID dest.destructor = src.destructor # this fixes 'type TLock = TSysLock': if src.sym != nil: diff --git a/compiler/rodread.nim b/compiler/rodread.nim index 5dccee9a71..a4287f8e8c 100755 --- a/compiler/rodread.nim +++ b/compiler/rodread.nim @@ -327,9 +327,6 @@ proc decodeType(r: PRodReader, info: TLineInfo): PType = result.align = decodeVInt(r.s, r.pos) else: result.align = 2 - if r.s[r.pos] == '@': - inc(r.pos) - result.containerID = decodeVInt(r.s, r.pos) decodeLoc(r, result.loc, info) while r.s[r.pos] == '^': inc(r.pos) diff --git a/compiler/rodwrite.nim b/compiler/rodwrite.nim index c0a0cc4eb7..9eab844d19 100755 --- a/compiler/rodwrite.nim +++ b/compiler/rodwrite.nim @@ -230,9 +230,6 @@ proc encodeType(w: PRodWriter, t: PType, result: var string) = if t.align != 2: add(result, '=') encodeVInt(t.align, result) - if t.containerID != 0: - add(result, '@') - encodeVInt(t.containerID, result) encodeLoc(w, t.loc, result) for i in countup(0, sonsLen(t) - 1): if t.sons[i] == nil: diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index c38e2f3ad6..9867c20bec 100755 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -532,9 +532,6 @@ proc typeSectionRightSidePass(c: PContext, n: PNode) = openScope(c.tab) pushOwner(s) if s.magic == mNone: s.typ.kind = tyGenericBody - if s.typ.containerID != 0: - InternalError(a.info, "semTypeSection: containerID") - s.typ.containerID = s.typ.id # XXX for generic type aliases this is not correct! We need the # underlying Id really: # diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index bda0047cab..db2ef1b3f0 100755 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -769,9 +769,6 @@ proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType = return newOrPrevType(tyError, prev, c) elif s.typ.kind != tyGenericBody: isConcrete = false - elif s.typ.containerID == 0: - InternalError(n.info, "semtypes.semGeneric") - return newOrPrevType(tyError, prev, c) elif sonsLen(n) != sonsLen(s.typ): LocalError(n.info, errWrongNumberOfArguments) return newOrPrevType(tyError, prev, c) diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 953dcfa747..72a5762a95 100755 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -493,11 +493,10 @@ proc typeRel(c: var TCandidate, f, a: PType): TTypeRelation = # simply no match for now: nil elif x.kind == tyGenericInst and - (f.sons[0].containerID == x.sons[0].containerID) and - (sonsLen(x) - 1 == sonsLen(f)): - assert(x.sons[0].kind == tyGenericBody) - for i in countup(1, sonsLen(f) - 1): - if x.sons[i].kind == tyGenericParam: + (f.sons[0] == x.sons[0]) and + (sonsLen(x) - 1 == sonsLen(f)): + for i in countup(1, sonsLen(f) - 1): + if x.sons[i].kind == tyGenericParam: InternalError("wrong instantiated type!") elif typeRel(c, f.sons[i], x.sons[i]) <= isSubtype: return result = isGeneric