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

Given this method, why does the local `data` survive across the await even though locals normally live on the stack frame that gets unwound during suspension?

async Task<int> Sum() { int[] data = await LoadAsync(); await Task.Yield(); return data.Length; }