* TypeBuilder.cs (GetField): Avoid a crash if this is called on a
FieldOnTypeBuilderInst. Fixes #586944.
svn path=/trunk/mcs/; revision=154580
+2010-04-01 Zoltan Varga <vargaz@gmail.com>
+
+ * TypeBuilder.cs (GetField): Avoid a crash if this is called on a
+ FieldOnTypeBuilderInst. Fixes #586944.
+
2010-03-30 Zoltan Varga <vargaz@gmail.com>
* ModuleBuilder.cs (DefinedType): Lookup inside the name_cache before creating
if (type.IsGenericTypeDefinition)
throw new ArgumentException ("Type cannot be a generic type definition", "type");
+ if (field is FieldOnTypeBuilderInst)
+ throw new ArgumentException ("The specified field must be declared on a generic type definition.", "field");
+
FieldInfo res = type.GetField (field);
if (res == null)
throw new System.Exception ("field not found");