Consider the general function:
object MyBox<T>(T value) { return (object)value; }
Compiled for:
ldarg.1 box 01 00 00 1B ret
The expected behavior of this function is no-op if T is a reference type, boxing a value for itself.
Boxing - a value that is known as a reference type, is less useful, but specifying it in such a way that, according to generics, is simple and consistent.
source share