* Fixes #5225

* Fixes #5225

* Fixes #5225

fix typo
This commit is contained in:
Lolo Iccl
2017-01-19 05:04:03 +09:00
committed by Andreas Rumpf
parent fe0291f127
commit a296f091e4
2 changed files with 19 additions and 1 deletions

View File

@@ -263,9 +263,16 @@ proc semRoutineInTemplBody(c: var TemplCtx, n: PNode, k: TSymKind): PNode =
n.sons[namePos] = ident
else:
n.sons[namePos] = semRoutineInTemplName(c, n.sons[namePos])
# open scope for parameters
openScope(c)
for i in patternPos..bodyPos:
for i in patternPos..miscPos:
n.sons[i] = semTemplBody(c, n.sons[i])
# open scope for locals
openScope(c)
n.sons[bodyPos] = semTemplBody(c, n.sons[bodyPos])
# close scope for locals
closeScope(c)
# close scope for parameters
closeScope(c)
proc semTemplSomeDecl(c: var TemplCtx, n: PNode, symKind: TSymKind; start=0) =

View File

@@ -0,0 +1,11 @@
discard """
output: "10"
"""
template something(name: untyped) =
proc name(x: int) =
var x = x # this one should not be rejected by the compiler (#5225)
echo x
something(what)
what(10)