So, I just caught this error in our code:
class A { public int a; } var x = new A(); xa = 1; A qwe(ref A t) { t = new A(); ta = 2; return t; } void asd(A m, A n) { Console.WriteLine(ma); Console.WriteLine(na); } asd(x, qwe(ref x)); asd(x, qwe(ref x));
Is the execution order in the function call specified with respect to the order of the parameters?
What is written here:
1 2 2 2
This means that the first parameter reference is saved until the second parameter function is called.
Is this a specific behavior? I could not find specific information about the execution order in the C # lang spec.
source share