I am sure if the Title is explainatory or not, but I need some help understanding the concept.
We have class (reference types) that has method table associated with Type object. In addition to the method tables, the type object also contains all the static fields, type obj pointer and sync block index.
CLR refers to this method table when calling methods on instance of a reference type.
Method table contains the IL for a particular method that is used to change the state of instance fields.
Similarly we can define methods for a structs (value types).
At runtime, when a method is called on a value type, from where does the CLR refer to the IL of the method being called on the instance of the value type.
struct A
{
// for Immutability of value type
public readonly int a;
public void MethodOnValueType()
{
// Some code here
}
}
Where does CLR refer to find the IL for the method named "MethodOnValueType"?
Is there any Type Object for the value type in the managed heap?
I am sure for the case of reference types but confused for value types.
Thanks.