attempt to fix #5621 #5615 generic ref object typeRel (#5633)

This commit is contained in:
andri lim 2017-04-01 02:58:09 +07:00 • committed by Andreas Rumpf
commit fce4b7cd62
2 changed files with 43 additions and 1 deletions

View file

@ -472,7 +472,7 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType =
var r = replaceTypeVarsT(cl, result.sons[i])
if result.kind == tyObject:
# carefully coded to not skip the precious tyGenericInst:
let r2 = r.skipTypes({tyGenericInst, tyAlias})
let r2 = r.skipTypes({tyAlias})
if r2.kind in {tyPtr, tyRef}:
r = skipTypes(r2, {tyPtr, tyRef})
result.sons[i] = r