t18859.nim 233 B

123456789101112131415161718
  1. import macros
  2. macro symFromDesc(T: typedesc): untyped =
  3. let typ = getType(T)
  4. typ[1]
  5. template produceType(T: typedesc): untyped =
  6. type
  7. XT = object
  8. x: symFromDesc(T)
  9. XT
  10. type
  11. X[T] = produceType(T)
  12. var x: X[int]