Author: zoltan
Date: 2005-05-13 07:45:53 -0400 (Fri, 13 May 2005)
New Revision: 44493

Modified:
   trunk/mcs/class/corlib/System.Reflection/ChangeLog
   trunk/mcs/class/corlib/System.Reflection/MonoField.cs
Log:
2005-05-13  Zoltan Varga  <[EMAIL PROTECTED]>

        * MonoField.cs: Applied patch from Opened by Michael Meeks ([EMAIL 
PROTECTED]). Improve exception message on binding failures.


Modified: trunk/mcs/class/corlib/System.Reflection/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System.Reflection/ChangeLog  2005-05-13 09:43:26 UTC 
(rev 44492)
+++ trunk/mcs/class/corlib/System.Reflection/ChangeLog  2005-05-13 11:45:53 UTC 
(rev 44493)
@@ -1,3 +1,7 @@
+2005-05-13  Zoltan Varga  <[EMAIL PROTECTED]>
+
+       * MonoField.cs: Applied patch from Opened by Michael Meeks ([EMAIL 
PROTECTED]). Improve exception message on binding failures.
+
 2005-05-09  Lluis Sanchez Gual  <[EMAIL PROTECTED]>
 
        * MonoField.cs: Added a Clone method. This is needed for serialization.

Modified: trunk/mcs/class/corlib/System.Reflection/MonoField.cs
===================================================================
--- trunk/mcs/class/corlib/System.Reflection/MonoField.cs       2005-05-13 
09:43:26 UTC (rev 44492)
+++ trunk/mcs/class/corlib/System.Reflection/MonoField.cs       2005-05-13 
11:45:53 UTC (rev 44493)
@@ -118,9 +118,11 @@
                        if (binder == null)
                                binder = Binder.DefaultBinder;
                        if (val != null) {
-                               val = binder.ChangeType (val, type, culture);
-                               if (val == null)
-                                       throw new ArgumentException ("Object 
type cannot be converted to target type.", "val");
+                               object newVal;
+                               newVal = binder.ChangeType (val, type, culture);
+                               if (newVal == null)
+                                       throw new ArgumentException ("Object 
type " + val.GetType() + " cannot be converted to target type: " + type, "val");
+                               val = newVal;
                        }
                        SetValueInternal (this, obj, val);
                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to