summary refs log tree commit diff stats
path: root/tests/generics/tinferredgenericprocs.nim
blob: ac445fd32da246fb7fe78b236350ce138e7d4980 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
discard """
  output: '''123
1
2
3'''
"""

# https://github.com/Araq/Nimrod/issues/797
proc foo[T](s:T):string = $s

type IntStringProc = proc(x: int): string 

var f1 = IntStringProc(foo)
var f2: proc(x: int): string = foo
var f3: IntStringProc = foo

echo f1(1), f2(2), f3(3)

for x in map([1,2,3], foo): echo x