This commit is contained in:
Zahary Karadjov 2017-06-10 22:03:35 +03:00 • committed by Andreas Rumpf
commit ba61e7e3ac
3 changed files with 51 additions and 1 deletions

View file

@ -127,7 +127,8 @@ proc replaceTypeVarsT*(cl: var TReplTypeVars, t: PType): PType =
proc prepareNode(cl: var TReplTypeVars, n: PNode): PNode =
let t = replaceTypeVarsT(cl, n.typ)
if t != nil and t.kind == tyStatic and t.n != nil:
return t.n
return if tfUnresolved in t.flags: prepareNode(cl, t.n)
else: t.n
result = copyNode(n)
result.typ = t
if result.kind == nkSym: result.sym = replaceTypeVarsS(cl, n.sym)

View file

@ -1781,6 +1781,13 @@ proc paramTypesMatchAux(m: var TCandidate, f, a: PType,
arg.typ.sons = @[evaluated.typ]
arg.typ.n = evaluated
a = arg.typ
else:
if m.callee.kind == tyGenericBody:
if f.kind == tyStatic and typeRel(m, f.base, a) != isNone:
result = makeStaticExpr(m.c, arg)
result.typ.flags.incl tfUnresolved
result.typ.n = arg
return
var r = typeRel(m, f, a)