proc arguments are in scope when the result type definition is being processed
This is intended for type deduction depending on the arguments proc foo(x: type): type(expr(x))
This commit is contained in:
parent
e4e74034c2
commit
de4b894541
5 changed files with 16 additions and 5 deletions
|
|
@ -185,7 +185,8 @@ proc semTemplateDef(c: PContext, n: PNode): PNode =
|
|||
# use ``stmt`` as implicit result type
|
||||
s.typ.sons[0] = newTypeS(tyStmt, c)
|
||||
s.typ.n.sons[0] = newNodeIT(nkType, n.info, s.typ.sons[0])
|
||||
addParams(c, s.typ.n) # resolve parameters:
|
||||
# XXX: obsoleted - happens in semParamList #
|
||||
# addParams(c, s.typ.n) # resolve parameters:
|
||||
var toBind = initIntSet()
|
||||
n.sons[bodyPos] = resolveTemplateParams(c, n.sons[bodyPos], false, toBind)
|
||||
if s.typ.sons[0].kind notin {tyStmt, tyTypeDesc}:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue