The following code works: 
    
    
    import typeinfo
    
    type
      Foo = object
        field: int
    
    var foo = Foo(field: 123)
    echo foo.field
    
    let x = foo.toAny
    echo x["field"].getInt
    
    
    Run

Reply via email to