Fix 105, few fixes for 101 (#11148)
This commit is contained in:
parent
20e3a39d6c
commit
45759b5e90
4 changed files with 7 additions and 4 deletions
|
|
@ -63,11 +63,10 @@ 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} + tyTypeClasses:
|
||||
if t.kind in {tyStatic, tyError, tyGenericParam} + tyTypeClasses:
|
||||
return
|
||||
gt.sym.typeInstCache.add(inst)
|
||||
|
||||
|
||||
type
|
||||
LayeredIdTable* = object
|
||||
topLayer*: TIdTable
|
||||
|
|
@ -363,6 +362,9 @@ proc handleGenericInvocation(cl: var TReplTypeVars, t: PType): PType =
|
|||
# but we already raised an error!
|
||||
rawAddSon(result, header.sons[i])
|
||||
|
||||
if body.kind == tyError:
|
||||
return
|
||||
|
||||
let bbody = lastSon body
|
||||
var newbody = replaceTypeVarsT(cl, bbody)
|
||||
let bodyIsNew = newbody != bbody
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue