mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
16 lines
243 B
Nim
16 lines
243 B
Nim
type
|
|
Foo*[T] = object
|
|
v*: T
|
|
|
|
template `+`*(x: Foo, y: Foo): untyped = x
|
|
|
|
template newvar*(r: untyped): untyped {.dirty.} =
|
|
var r: float
|
|
|
|
template t1*(x: Foo): untyped =
|
|
newvar(y1)
|
|
x
|
|
template t2*(x: Foo): untyped =
|
|
newvar(y2)
|
|
x
|