Skip to content

Instantly share code, notes, and snippets.

@gdyrrahitis
Created June 22, 2019 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdyrrahitis/eb12e786b060cce19ad4f586a113c6a4 to your computer and use it in GitHub Desktop.
Save gdyrrahitis/eb12e786b060cce19ad4f586a113c6a4 to your computer and use it in GitHub Desktop.
.method public hidebysig
instance void CastingInterface () cil managed
{
// Method begins at RVA 0x2068
// Code size 27 (0x1b)
.maxstack 2
.locals init (
[0] object
)
IL_0000: ldc.i4.s 10
IL_0002: box [System.Runtime]System.Int32 // Boxes the num1 integer - No surprise here
IL_0007: stloc.0
IL_0008: ldc.i4.s 12
IL_000a: box [System.Runtime]System.Int32 // Boxes the num2 integer - Casted to an interface
IL_000f: ldloc.0
IL_0010: callvirt instance int32 [System.Runtime]System.IComparable::CompareTo(object)
IL_0015: call void [System.Console]System.Console::WriteLine(int32)
IL_001a: ret
} // end of method Class2::CastingInterface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment