2008-03-14 Zoltan Varga <vargaz@gmail.com>
+ * MonoGenericClass.cs (GetField): Construct a FieldOnTypeBuilderInst object
+ instead of using GetCorrespondingInflatedField. This is needed so this class can
+ reflect the changes made to the type builder after initialize () has been called.
+
* Binder.cs (ChangeType): Add support for Char->Double/Single conversations. Fixes
#367655.
*/
internal class MonoGenericClass : MonoType
{
+ #region Keep in sync with object-internals.h
protected TypeBuilder generic_type;
bool initialized;
+ #endregion
+
+ Hashtable fields;
internal MonoGenericClass ()
: base (null)
{
initialize ();
+#if NET_2_0
+ if (fromNoninstanciated is FieldBuilder) {
+ FieldBuilder fb = (FieldBuilder)fromNoninstanciated;
+ if (fields == null)
+ fields = new Hashtable ();
+ if (!fields.ContainsKey (fb))
+ fields [fb] = new FieldOnTypeBuilderInst (this, fb);
+ return (FieldInfo)fields [fb];
+ }
+#endif
+ /* Keep the old code for a while in case the code above needs to be reverted */
return GetCorrespondingInflatedField (fromNoninstanciated.Name);
}