Skip to content

Instantly share code, notes, and snippets.

@SriramSakthivel
Last active August 29, 2015 14:16
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 SriramSakthivel/66ac5c63a369732672ec to your computer and use it in GitHub Desktop.
Save SriramSakthivel/66ac5c63a369732672ec to your computer and use it in GitHub Desktop.
Snippet to show that C# compiler emits call for instance methods
void Main()
{
SomeClass sc = new SomeClass();
sc.DoSomething();//callvirt is emitted
new SomeClass().DoSomething();//call is emitted
}
public class SomeClass
{
public void DoSomething()
{
Console.WriteLine("I'm doing something");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment