mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-07 21:43:33 +00:00
31 lines
406 B
Nim
31 lines
406 B
Nim
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)
|