Skip to content

Instantly share code, notes, and snippets.


gdyrrahitis/boxing.cs Secret

Created Jun 22, 2019
What would you like to do?
.method public hidebysig
instance void MethodOverloads () cil managed
// Method begins at RVA 0x2068
// Code size 47 (0x2f)
.maxstack 2
.locals init (
[0] int32
IL_0000: ldc.i4.s 100
IL_0002: stloc.0
IL_0003: ldstr "Value is "
IL_0008: ldloc.0
IL_0009: box [System.Runtime]System.Int32 // Boxed value type for the first WriteLine call
IL_000e: call string [System.Runtime]System.String::Concat(object, object) // Uses the object parameter overload
IL_0013: call void [System.Console]System.Console::WriteLine(string)
IL_0018: ldstr "Value is "
IL_001d: ldloca.s 0
IL_001f: call instance string [System.Runtime]System.Int32::ToString()
IL_0024: call string [System.Runtime]System.String::Concat(string, string) // Uses the string parameter overload
IL_0029: call void [System.Console]System.Console::WriteLine(string)
IL_002e: ret
} // end of method Class2::MethodOverloads
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment