summary refs log tree commit diff stats
path: root/tests/closure/ttimeinfo.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/closure/ttimeinfo.nim')
-rw-r--r--tests/closure/ttimeinfo.nim15
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)
+)