I\'ve often wondered if the following scenario actually happens in c#
If I have a struct but I don\'t explicitly override any of the methods that derived from objec
If
thisTypeis a value type andthisTypedoes not implement method then ptr is dereferenced, boxed, and passed as the 'this' pointer to the callvirt method instruction.This last case can occur only when method was defined on
Object,ValueType, orEnumand not overridden bythisType. In this case, the boxing causes a copy of the original object to be made.
The answer is yes, the value type is boxed. This is why it is always a good thing to override ToString() on custom structs.