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
- Module typeinfo, can't access field by name. Bug or not? moigagoo
- Re: Module typeinfo, can't access field by name. Bug or not? slangmgh
