From: Zoltan Varga Date: Fri, 14 Mar 2008 18:50:24 +0000 (-0000) Subject: 2008-03-14 Zoltan Varga X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=5ac4316de5529ccecb7e9650c86e9f10468e7211;p=mono.git 2008-03-14 Zoltan Varga * 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. svn path=/trunk/mcs/; revision=98330 --- diff --git a/mcs/class/corlib/System.Reflection/ChangeLog b/mcs/class/corlib/System.Reflection/ChangeLog index 24b7cd8ea54..278f4f85ef2 100644 --- a/mcs/class/corlib/System.Reflection/ChangeLog +++ b/mcs/class/corlib/System.Reflection/ChangeLog @@ -1,5 +1,9 @@ 2008-03-14 Zoltan Varga + * 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. diff --git a/mcs/class/corlib/System.Reflection/MonoGenericClass.cs b/mcs/class/corlib/System.Reflection/MonoGenericClass.cs index 9f76d5b6cba..13c0e83921f 100644 --- a/mcs/class/corlib/System.Reflection/MonoGenericClass.cs +++ b/mcs/class/corlib/System.Reflection/MonoGenericClass.cs @@ -50,8 +50,12 @@ namespace System.Reflection */ 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) @@ -149,6 +153,17 @@ namespace System.Reflection { 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); }