ref Locals and Returns
Aliases to storage, ref returns, ref readonly, managed pointers, in-place updates
A ref local (ref int x = ref array[0];) is not a new variable holding a value: it is an alias, a managed pointer to existing storage such as an array element, a field or another variable. Reading or writing x reads or writes that…