2
Vote

Cannot pass a single element array to C#

description

For a C# method defined as below:
 public static void TestRDataToCSharpTransfer(Array array)
It works perfectly if one do this:
clrCallStatic("xxx.xxx", "TestRDataToCSharpTransfer", c(1.0, 2.0))

However, if one try this:
clrCallStatic("xxx.xxx", "TestRDataToCSharpTransfer", c(1.0))

One will get this error:

Type: System.MissingMethodException
Message: Could not find a suitable static method TestRDataToCSharpTransfer on type XXX.XXX for method parameters Double
Method: Void ThrowMissingMethod(System.Type, System.String, System.String, System.Type[])
Stack trace:
at Rclr.ReflectionHelper.ThrowMissingMethod(Type classType, String methodName, String modifier, Type[] types) in c:\Users\per202\AppData\Local\Temp\RtmpCgiQDm\R.INSTALL25f0662d7f4e\rClr\src\ClrFacade\ReflectionHelper.cs:line 785
at Rclr.ClrFacade.InternalCallStaticMethod(Type classType, String methodName, Boolean tryUseConverter, Object[] arguments) in c:\Users\per202\AppData\Local\Temp\RtmpCgiQDm\R.INSTALL25f0662d7f4e\rClr\src\ClrFacade\ClrFacade.cs:line 89
at Rclr.ClrFacade.CallStaticMethod(String typename, String methodName, Object[] arguments) in c:\Users\per202\AppData\Local\Temp\RtmpCgiQDm\R.INSTALL25f0662d7f4e\rClr\src\ClrFacade\ClrFacade.cs:line 138

comments