fixes #1902
This commit is contained in:
parent
540f66cb09
commit
aef7be2e79
2 changed files with 20 additions and 4 deletions
15
tests/fields/tfields_in_template.nim
Normal file
15
tests/fields/tfields_in_template.nim
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
discard """
|
||||
output: '''n
|
||||
n'''
|
||||
"""
|
||||
|
||||
# bug #1902
|
||||
# This works.
|
||||
for name, value in (n: "v").fieldPairs:
|
||||
echo name
|
||||
|
||||
# This doesn't compile - "expression 'name' has no type (or is ambiguous)".
|
||||
template wrapper: stmt =
|
||||
for name, value in (n: "v").fieldPairs:
|
||||
echo name
|
||||
wrapper()
|
||||
Loading…
Add table
Add a link
Reference in a new issue