In F#, I can write a function (fun x -> x * x) and confirm it has type int->int because the following code compiles:
let typeCheck<'T> (x:'T) = ()
typeCheck<int->int> (fun x -> x*x)
On the other hand, GetType for this function doesn't agree with typeof<int->int>:
> (fun x -> x*x).GetType() = typeof<int -> int>
val it : bool = false
If not GetType() and typeof, what functions can I call to mimic the type-checking done by the compiler?