[runtime] Updates comments.
[mono.git] / mcs / class / corlib / System.Reflection / MonoField.cs
index e374e5176621d48595264ef32eb58ca28504d5e9..117eea363fd520e7c1998c4aedd28d2f0f580a37 100644 (file)
@@ -41,9 +41,24 @@ using System.Runtime.Serialization;
 
 namespace System.Reflection {
 
+       abstract class RuntimeFieldInfo : FieldInfo
+       {
+               internal BindingFlags BindingFlags {
+                       get {
+                               return 0;
+                       }
+               }
+       }
+
+       abstract class RtFieldInfo : RuntimeFieldInfo
+       {
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               internal extern object UnsafeGetValue (object obj);
+       }
+
        [Serializable]
        [StructLayout (LayoutKind.Sequential)]
-       internal class MonoField : FieldInfo, ISerializable {
+       internal class MonoField : RtFieldInfo, ISerializable {
                internal IntPtr klass;
                internal RuntimeFieldHandle fhandle;
                string name;
@@ -146,10 +161,11 @@ namespace System.Reflection {
                        if (IsLiteral)
                                throw new FieldAccessException ("Cannot set a constant field");
                        if (binder == null)
-                               binder = Binder.DefaultBinder;
+                               binder = Type.DefaultBinder;
                        CheckGeneric ();
                        if (val != null) {
-                               val = binder.ConvertValue (val, FieldType, culture, (invokeAttr & BindingFlags.ExactBinding) != 0);
+                               RuntimeType fieldType = (RuntimeType) FieldType;
+                               val = fieldType.CheckValue (val, binder, culture, invokeAttr);
                        }
                        SetValueInternal (this, obj, val);
                }