Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC#async/await state machineSingle-choice MCQ

In the code below (Release, default SynchronizationContext), how many times is the async state machine struct heap-allocated across the whole call, assuming the inner Task is already completed when awaited?

async Task<int> Outer() { int a = await AlreadyDone(); // Task<int> already completed return a + 1; }