Hi,

How can I find out the original type of an object that has been 
promoted/demoted/casted (what is the right term here?) to a parent type without 
testing for each individual type with the of operator?
    
    
    import macros
    
    macro test(a: typed): untyped =
      # how to get "T2" here?
    
    type
      T1 = ref object of RootObj
      
      T2 = ref object of T1
    
    var a = T1(T2())
    test a
    
    
    Run

Reply via email to