importB.nim 243 B

12345678910111213141516
  1. type
  2. Foo*[T] = object
  3. v*: T
  4. template `+`*(x: Foo, y: Foo): untyped = x
  5. template newvar*(r: untyped): untyped {.dirty.} =
  6. var r: float
  7. template t1*(x: Foo): untyped =
  8. newvar(y1)
  9. x
  10. template t2*(x: Foo): untyped =
  11. newvar(y2)
  12. x