public const int UNSAFE = 0x2000;
public const int TOP = 0x2000;
+ public const int PROPERTY_CUSTOM = 0x4000; // Custom property modifier
+
//
// We use this internally to flag that the method contains an iterator
//
return s;
}
+ public static string GetDescription (MethodAttributes ma)
+ {
+ if ((ma & MethodAttributes.Assembly) != 0)
+ return "internal";
+
+ if ((ma & MethodAttributes.Family) != 0)
+ return "protected";
+
+ if ((ma & MethodAttributes.Public) != 0)
+ return "public";
+
+ if ((ma & MethodAttributes.FamANDAssem) != 0)
+ return "protected internal";
+
+ if ((ma & MethodAttributes.Private) != 0)
+ return "private";
+
+ throw new NotImplementedException (ma.ToString ());
+ }
+
public static TypeAttributes TypeAttr (int mod_flags, bool is_toplevel)
{
TypeAttributes t = 0;
int a = mod;
if ((mod & Modifiers.UNSAFE) != 0){
- if (!RootContext.Unsafe){
- Report.Error (227, l,
- "Unsafe code requires the -unsafe command " +
- "line option to be specified");
- }
+ RootContext.CheckUnsafeOption (l);
}
//
public static void Error_InvalidModifier (Location l, string name)
{
- Report.Error (106, l, "the modifier " + name + " is not valid for this item");
+ Report.Error (106, l, "The modifier `" + name + "' is not valid for this item");
}
}
}