Why are async state machines classes (and not structs) in Roslyn?
Let’s consider this very simple async method: static async Task myMethodAsync() { await Task.Delay(500); } When I compile this with VS2013 (pre Roslyn compiler) the generated state-machine is a struct. private struct <myMethodAsync>d__0 : IAsyncStateMachine { ... void IAsyncStateMachine.MoveNext() { ... } } When I compile it with VS2015 (Roslyn) the generated code is this: private sealed class <myMethodAsync>d__1 : IAsyncStateMachine { ... void IAsyncStateMachine.MoveNext() { ... } } As you can see Roslyn generates a class (and not a struct). If I remember correctly the first implementations