Get field type names
Maaarcocr opened this issue · 2 comments
Maaarcocr commented
I have a simple struct defined by this code:
struct Test {
pub test: String,
}
Using the reflect module and some similar to the examples, I get each field of the Struct. I want to also know the type of each field, so I call field.get_value().get_type_name()
but it panics. Is what I'm trying to do something that can be supported?
I would be up to contribute a solution for this, but I'm not sure where to start.
8BitMate commented
Something along these lines should be possible. I'm about to go to bed right now, but I'll have a look at it tomorrow.
8BitMate commented
It should work now for your example. Beware though that it will not work yet for generic types as this is not implemented yet, but it is something I'm working on.