Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC#ref struct and ref returnsSingle-choice MCQ

Why does this method fail to compile, and what specific escape rule is being enforced?

static Span<int> GetBuffer() { Span<int> buf = stackalloc int[4]; return buf; }