Say I have the following code:
void Main()
{
int a = 5;
f1(ref a);
}
public void f1(ref int a)
{
if(a > 7) return;
a++;
f1(ref a);
Co
I think you are mistaken in saying the int
parameter is being boxed. From MSDN,
Boxing is the process of converting a value type to the type object or to any interface type implemented by this value type
What you have here is an int
parameter being passed by reference, specifically it's a "value type" being passed by reference.
You can refer to Jon Skeet's excellent explanation on parameter passing for details.