blob: f9d5e7910c6926a2779ba9338484940e1a2fa8ed (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# bug 2659
type
GenProcType[T,U] = proc(x:T, y:var U)
IntProcType = proc(x:int, y:var int)
proc mult(x:int, y:var int) =
y = 2 * x
when isMainModule:
var input = 1
var output = 0
var someIntProc:IntProcType = mult
var someGenProc:GenProcType[int,int] = mult
mult(input, output)
echo output
someIntProc(input, output)
echo output
# Uncommenting causes an error in the C compiler.
someGenProc(input, output)
echo output
|