Wizend, if you look closely to my original code, you would find I already used "params"; however, I am still getting a "Standard" MethodInfo.
Yes, of course I've seen that. But, what I tried to point at and apparently failed by doing so, is that the vararg constraint is not part of the Common Lanuage Specification and the only calling convention supported by the CLS is the "standard" managed calling convention (for details, http://msdn.microsoft.com/en-us/library/12a7a7h3%28v=vs.110%29.aspx). Because using the 'params' keyword, even if it allows to use a variable number of arguments in C# similar to what the _arglist keyword allows, is supported by the CLS, its CallingConvention will always be "standard". The enum value "VarArgs" is reserved for those methods that are not CLS compliant (e.g. because of using the _arglist keyword as explained in those library article regarding the warning message CA2230 I mentioned earlier).
No comments:
Post a Comment