C# compiler
What the C# compiler generates from your code: iterator state machines, local functions, the IL it emits for everyday calls and casts, and Roslyn syntax rewriters.
Writing IL according to the specification
Writing IL that matches what the C# compiler emits: how is, as, casts, and generic constraints turn into box, isinst, and castclass.
C# behind the scenes
The introduction to a series on the code the C# compiler generates for language features such as yield and local functions.
C# behind the scenes: Local functions
How the C# compiler turns local functions into ordinary methods, and how captured variables move into a generated display struct.
C# behind the scenes: yield
How the C# compiler turns an iterator method that uses yield return into a generated state machine class.
Value type methods: call, callvirt, constrained, and hidden boxing
How call, callvirt, and the constrained prefix work for value type methods, and when calling ToString on a struct quietly boxes it.
Making a method static with Roslyn
A Roslyn syntax rewriter that turns an instance method into a static method, with the source on GitHub.
What is the @ sign before a variable name?
What the @ prefix on a C# identifier does, why the compiled name drops it, and how that can break reflection lookups by name.
Converting LINQ query syntax to fluent syntax with Roslyn
A Roslyn syntax rewriter that converts LINQ query comprehension syntax into the equivalent fluent method calls.
IL call vs. callvirt, part two
When the C# compiler emits call instead of callvirt, such as for static methods, struct methods, and calls on a newly created object, shown in IL and disassembly.
IL call vs. callvirt
Why the C# compiler emits callvirt even for non-virtual methods: the difference between call and callvirt, and the null check that callvirt provides.