t5926.nim 254 B

1234567891011121314151617181920212223
  1. discard """
  2. action: compile
  3. """
  4. type
  5. SomeObj[T] = object
  6. template useSomeObj[T]() =
  7. var retObj: SomeObj[T]
  8. useSomeObj[void]()
  9. useSomeObj[int]()
  10. type
  11. Data*[T] = object
  12. x: T
  13. template test*[T](xxx: T) =
  14. let data = Data[T](x: xxx)
  15. test(1)