I am not sure if my code is valid (without last line, it can compile and run) import typetraits type Parent {.inheritable.} = object Child = object of Parent proc super(_: typedesc[Parent]): typedesc = typedesc[void] proc super(_: typedesc[Child]): typedesc = typedesc[Parent] echo Parent.name echo Child.name #echo Child.super.name Run
The last line is compile with error Error: expression 'super(Child)' has no type (or is ambiguous) Run