parent
cb21fd4f8f
commit
12f22ba68a
4 changed files with 9 additions and 6 deletions
|
|
@ -121,9 +121,10 @@ proc generateInstance(c: PContext, fn: PSym, pt: TIdTable,
|
|||
instantiateGenericParamList(c, n.sons[genericParamsPos], pt, entry)
|
||||
n.sons[genericParamsPos] = ast.emptyNode
|
||||
# semantic checking for the parameters:
|
||||
if n.sons[paramsPos].kind != nkEmpty:
|
||||
if n.sons[paramsPos].kind != nkEmpty:
|
||||
removeDefaultParamValues(n.sons[ParamsPos])
|
||||
semParamList(c, n.sons[ParamsPos], nil, result)
|
||||
#echo "generated this return type: ", renderTree(n.sons[ParamsPos])
|
||||
addParams(c, result.typ.n)
|
||||
else:
|
||||
result.typ = newTypeS(tyProc, c)
|
||||
|
|
|
|||
|
|
@ -231,7 +231,8 @@ proc typeRel(mapping: var TIdTable, f, a: PType): TTypeRelation =
|
|||
assert(f != nil)
|
||||
assert(a != nil)
|
||||
if a.kind == tyGenericInst and
|
||||
skipTypes(f, {tyVar}).kind notin {tyGenericBody, tyGenericInvokation}:
|
||||
skipTypes(f, {tyVar}).kind notin {
|
||||
tyGenericBody, tyGenericInvokation, tyGenericParam}:
|
||||
return typeRel(mapping, f, lastSon(a))
|
||||
if a.kind == tyVar and f.kind != tyVar:
|
||||
return typeRel(mapping, f, a.sons[0])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue