Member predicate Call::getRuntimeArgument
Gets the argument that corresponds to the ith parameter of a potential
run-time target of this call.
Unlike getArgument(), this predicate takes reflection based calls and named
arguments into account. Example:
class A {
virtual void M(int first, int second) { }
static void CallM(A a) {
a.M(second: 1, first: 2);
typeof(A).InvokeMember("M", BindingFlags.Public, null, a, new int[]{ 1, 2 });
}
}
-
Line 5: The first and second arguments are
1and2, respectively. However, the first and second run-time arguments ofA.M()are2and1, respectively. -
Line 6: The static target is
Type.InvokeMember()and the first, second, third, fourth, and fifth arguments are"M",BindingFlags.Public,null,a, andnew int[]{ 1, 2 }, respectively. However, the run-time target isA.M()and the first and second arguments are1and2, respectively.