fixes #2540
This commit is contained in:
parent
dc65f9a5f7
commit
3df9d2bd0c
1 changed files with 8 additions and 2 deletions
|
|
@ -440,8 +440,14 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType =
|
||||||
|
|
||||||
for i in countup(0, sonsLen(result) - 1):
|
for i in countup(0, sonsLen(result) - 1):
|
||||||
if result.sons[i] != nil:
|
if result.sons[i] != nil:
|
||||||
result.sons[i] = replaceTypeVarsT(cl, result.sons[i])
|
var r = replaceTypeVarsT(cl, result.sons[i])
|
||||||
propagateToOwner(result, result.sons[i])
|
if result.kind == tyObject:
|
||||||
|
# carefully coded to not skip the precious tyGenericInst:
|
||||||
|
let r2 = r.skipTypes({tyGenericInst})
|
||||||
|
if r2.kind in {tyPtr, tyRef}:
|
||||||
|
r = skipTypes(r2, {tyPtr, tyRef})
|
||||||
|
result.sons[i] = r
|
||||||
|
propagateToOwner(result, r)
|
||||||
|
|
||||||
result.n = replaceTypeVarsN(cl, result.n)
|
result.n = replaceTypeVarsN(cl, result.n)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue