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

Given the `ref readonly` return and the two call sites, what is the actual difference in codegen between the two reads of `Origin`?

struct Big { public long A, B, C, D; } static readonly Big _o = default; static ref readonly Big Origin => ref _o; ref readonly Big r = ref Origin; // site 1 Big copy = Origin; // site 2