moverloading_typedesc.nim 313 B

123456789101112
  1. import tables
  2. type
  3. FFoo* = object
  4. FBar* = object
  5. proc new*(_: typedesc[FFoo]): int = 2
  6. proc new*[T](_: typedesc[T]): int = 3
  7. proc new*(_: typedesc): int = 4
  8. proc new*(_: typedesc[seq[Table[int, seq[Table[int, string]]]]]): int = 5
  9. proc new*(_: typedesc[seq[Table[int, seq[Table[int, typedesc]]]]]): int = 6