type
    T1Impl = object of RootObj
        field1:int
        
    T1 = ref T1Impl
    
    T2Impl = object of T1
        field2:int
        
    T2 = ref T2Impl

var a:T2

a = new(T2)
echo repr(a)

Add a code snippet to your website: www.paste.org