All the primitives : int8/16/32/64, uint8/16/32/64, float32/64, (unsigned)
native int, string, typedref, object, arrays are for sure special classes.
Even if they got no explicit unmanaged method associated with them, the JIT
will treat them in a special manner. You cannot just change them. int32 is
supposed to be 32 bits, no more ! For instance, every add operation on
integers would be compiled into a special instruction into the CIL (MSIL)
code.
But for classes such as ArrayList, List<> and so forth there should be no
prb (assuming the CLR would let you load the patched mscorlib assembly)
I think instead of changing the mscorlib assembly (which may not be allowed
by Microsoft), you should rethink your problem.
A solution that might work (but very hard to implement) would be to declare
a generic type
MySpecialType<T>
{
Field _Item :T
Field myAddedField : int (or any type you want)
}
than you should change every reference to a string, for instance, into a
reference to MySpecialType<string>.
Again, this solution would be very hard to implement.
--~--~---------~--~----~------------~-------~--~----~
--
mono-cecil
-~----------~----~----~----~------~----~------~--~---