summary refs log blame commit diff stats
path: root/tests/closure/ttimeinfo.nim
blob: 3138ae72e7ab1d88ce01275b39b48f0213433739 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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)
)