[Mono-devel-list] Inconsintency between reflection, Array and activator

Jose Cornado jcornado at yahoo.com
Mon Mar 29 09:08:55 EST 2004


The example is as follows:

Method signature:

public string[][][] TestMultiArray(string[][][])

*) Get info (instance, methodInfo, etc) via
reflection. Reflection correctly shows that the only
parameter that is required is a System.String[][][].

*) If I use any of the CreateInstance versions to
create an instance of the parameter (so I can invoke
the method) it throws an error. Apparently because
Type is already an array.

*) System.Array.CreateInstance does not have an option
that takes just a Type that is already an array. That
forces me to use a loop to dig out
UnderlyingSystemType until it becomes just
System.String (this happens in Mono as well as .Net)

*) If System.Activator is used to avoid the extra
loop, it throws a runtime exception that .ctor can not
be found? (just tried this with mono only)

Is this a known issue?

Has already been brought up here as well as the .Net
people?

BTW, I am using mono 0.29

Thanks a lot in advance!!

__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html



More information about the Mono-devel-list mailing list