From ada0f14711d3eff140f05f8a845cff5d489a71fd Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 8 Feb 2015 14:15:02 +0100 Subject: fixes #2073 --- tests/closure/ttimeinfo.nim | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/closure/ttimeinfo.nim (limited to 'tests/closure/ttimeinfo.nim') 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) +) -- cgit 1.4.1-2-gfad0