}\r
\r
public class AttributeSection {\r
- \r
public readonly string Target;\r
public readonly ArrayList Attributes;\r
\r
if (a != null && !AttributeSections.Contains (a))\r
AttributeSections.Add (a);\r
}\r
+\r
+ public bool Contains (Type t)\r
+ {\r
+ foreach (AttributeSection attr_section in AttributeSections){\r
+ foreach (Attribute a in attr_section.Attributes){\r
+ if (a.Type == t)\r
+ return true;\r
+ }\r
+ }\r
+ return false;\r
+ }\r
}\r
}\r
if (default_value == null)
return true;
-
} else {
+ if (name == "value__"){
+ Report.Error (76, loc, "The name `value__' is reserved for enumerations");
+ return false;
+ }
+
FieldBuilder fb = TypeBuilder.DefineField (
name, UnderlyingType, attr);
static public Type exception_type;
static public object obsolete_attribute_type;
static public object conditional_attribute_type;
+ static public Type in_attribute_type;
//
// An empty array of types
attribute_usage_type = CoreLookupType ("System.AttributeUsageAttribute");
dllimport_type = CoreLookupType ("System.Runtime.InteropServices.DllImportAttribute");
methodimpl_attr_type = CoreLookupType ("System.Runtime.CompilerServices.MethodImplAttribute");
- marshal_as_attr_type = CoreLookupType ("System.Runtime.InteropServices.MarshalAsAttribute");
- param_array_type = CoreLookupType ("System.ParamArrayAttribute");
+ marshal_as_attr_type = CoreLookupType ("System.Runtime.InteropServices.MarshalAsAttribute");
+ param_array_type = CoreLookupType ("System.ParamArrayAttribute");
+ in_attribute_type = CoreLookupType ("System.Runtime.InteropServices.InAttribute");
//
// Temporary while people upgrade their corlibs