vendredi 8 janvier 2016

How can I convert a System.Reflection.MemberInfo value into the F# value it represents?

I'm trying to load and execute F# code at runtime. The FSharp.Compiler.Service assembly produces System.Reflection.MemberInfo values for each value (or function) definition in a program.

I'm roughly trying to implement the following:

cast<'a> : System.Reflection.MemberInfo -> 'a

Which succeeds if the MemberInfo value represents a value of type 'a (and returns that value), or fails otherwise.





Aucun commentaire:

Enregistrer un commentaire