summary refs log tree commit diff stats
path: root/tests/template/tprocparshadow.nim
blob: de1c2d9412dfb37d039cb9cb6723761bfab89139 (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
29
30
discard """
  output: "10"
"""

template something(name: untyped) =
  proc name(x: int) =
    var x = x # this one should not be rejected by the compiler (#5225)
    echo x

something(what)
what(10)

# bug #4750

type
  O = object
    i: int

  OP = ptr O

template alf(p: pointer): untyped =
  cast[OP](p)


proc t1(al: pointer) =
  var o = alf(al)

proc t2(alf: pointer) =
  var x = alf
  var o = alf(x)