Hey Jb
My Bad,I am sure it does support generics.
The error was in handling Jagged and Rectangular Arrays ....


Look at an example code below

            public static T[,] Get2DArray<T>()
            {
                T[][] data = SomeServiceCall....;
                int col = data.Length;
                int row = data[0].Length;

                T[,] data2D = new T[col, row];
                for (int i = 0; i < col; i++)
                {
                    T[] dataRow = data[i];
                    for (int j = 0; j < row; j++)
                    {
                        data2D[i, j] = dataRow[j]; ///THIS THROWS THE
ERROR
                    }
                }
                return data2D;
            }

the resulting assembly in ILSpy displays the error for the method
as . . .

ICSharpCode.Decompiler.DecompilerException:
Error decompiling T[0...,0...] MasterLib.SomeArrayClass::Get2DArray()
 ---> System.InvalidCastException: Unable to cast object of type
'Mono.Cecil.MethodReference' to type
'Mono.Cecil.GenericInstanceMethod'.


SrcK

-- 
--
mono-cecil

Reply via email to