thnaks to my colleagues: Keith and Vlad, the solution to this problem is:
From methodInfo to quotation:
type T =
[]
static member M(x) = 1 + x
let methodInfo = typeof< T >.GetMethod( "M")
let e = Quotations.Expr.TryGetReflectedDefinition methodInfo
From quotation to methodInfo:
match <@ T.M 1 @> with
| Quotations.Patterns.Call(None, mi, args) -> mi
| _ -> failwith "Expected Call"
No comments:
Post a Comment