This commit is contained in:
Araq 2015-10-22 10:24:46 +02:00
commit d93507fd2e
4 changed files with 51 additions and 4 deletions

View file

@ -75,8 +75,12 @@ proc searchInstTypes*(key: PType): PType =
proc cacheTypeInst*(inst: PType) =
# XXX: add to module's generics
# update the refcount
let genericTyp = inst.sons[0]
genericTyp.sym.typeInstCache.safeAdd(inst)
let gt = inst.sons[0]
let t = if gt.kind == tyGenericBody: gt.lastSon else: gt
if t.kind in {tyStatic, tyGenericParam, tyIter} + tyTypeClasses:
return
gt.sym.typeInstCache.safeAdd(inst)
type
TReplTypeVars* {.final.} = object