removes 'x is iterator' special casing in the language

This commit is contained in:
Araq 2015-12-03 01:07:51 +01:00
commit 760242b870
10 changed files with 29 additions and 50 deletions

View file

@ -77,7 +77,7 @@ proc cacheTypeInst*(inst: PType) =
# update the refcount
let gt = inst.sons[0]
let t = if gt.kind == tyGenericBody: gt.lastSon else: gt
if t.kind in {tyStatic, tyGenericParam, tyIter} + tyTypeClasses:
if t.kind in {tyStatic, tyGenericParam} + tyTypeClasses:
return
gt.sym.typeInstCache.safeAdd(inst)
@ -390,7 +390,7 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType =
result = t
if t == nil: return
if t.kind in {tyStatic, tyGenericParam, tyIter} + tyTypeClasses:
if t.kind in {tyStatic, tyGenericParam} + tyTypeClasses:
let lookup = PType(idTableGet(cl.typeMap, t))
if lookup != nil: return lookup