diff options
author | Araq <rumpf_a@web.de> | 2015-02-08 14:15:02 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-02-08 14:15:02 +0100 |
commit | ada0f14711d3eff140f05f8a845cff5d489a71fd (patch) | |
tree | e3337ea1f321cbcfef6f72c5689bb634000a4771 /tests/closure/ttimeinfo.nim | |
parent | c91ca82a43917163f00cf86e59d80a8909dca80a (diff) | |
download | Nim-ada0f14711d3eff140f05f8a845cff5d489a71fd.tar.gz |
fixes #2073
Diffstat (limited to 'tests/closure/ttimeinfo.nim')
-rw-r--r-- | tests/closure/ttimeinfo.nim | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/closure/ttimeinfo.nim b/tests/closure/ttimeinfo.nim new file mode 100644 index 000000000..3138ae72e --- /dev/null +++ b/tests/closure/ttimeinfo.nim @@ -0,0 +1,15 @@ +# bug #2073 + +import sequtils +import times + +# 1 +proc f(n: int): TimeInfo = + TimeInfo(year: n, month: mJan, monthday: 1) + +echo toSeq(2000 || 2015).map(f) + +# 2 +echo toSeq(2000 || 2015).map(proc (n: int): TimeInfo = + TimeInfo(year: n, month: mJan, monthday: 1) +) |