I was wondering if it were possible to obtain the run time type of method callers in the stack trace.
Consider the following example:
class Parent
{
No. The reason is described by Raymond Chen here.
The relevant quote is:
An object in a block of code can become eligible for collection during execution of a function it called.
It's not intuitive, read the part about JIT and GC working together.
Getting the actual Type requires the instance, but the optimization effort is geared toward making that Garbage, so you can't rely on it still being there.