{
if (!IsStatic && obj == null)
throw new TargetException ("Non-static field requires a target");
+ CheckGeneric ();
return GetValueInternal (obj);
}
throw new FieldAccessException ("Cannot set a constant field");
if (binder == null)
binder = Binder.DefaultBinder;
+ CheckGeneric ();
if (val != null) {
object newVal;
newVal = binder.ChangeType (val, type, culture);
[MethodImplAttribute(MethodImplOptions.InternalCall)]
public override extern object GetRawConstantValue ();
#endif
+
+ void CheckGeneric () {
+#if NET_2_0
+ if (DeclaringType.ContainsGenericParameters)
+ throw new InvalidOperationException ("Late bound operations cannot be performed on fields with types for which Type.ContainsGenericParameters is true.");
+#endif
+ }
}
}