Why cannot return a nested ref return result if the inner method has another ref/out parameter?
问题 I thought I understood limitations of ref returns as well as escaping scopes. But now I found a case and I don't get why is it illegal. It seems that ref return cannot be used if the value to return comes from a nested method with any ref/out arguments. public static ref T RefReturn<T>() { ref T result = ref GetResult<T>(normalParam: default); // compiles // ref T result = ref GetResult<T>(out bool outParam); // CS8157 at the return statement // ref T result = ref GetResult<T>(boxedParam: new