return s;
}
- public static TypeAttributes TypeAttr (int mod_flags, TypeContainer caller)
+ public static TypeAttributes TypeAttr (int mod_flags, bool is_toplevel)
{
TypeAttributes t = 0;
- bool top_level = caller.IsTopLevel;
- if (top_level){
+ if (is_toplevel){
if ((mod_flags & PUBLIC) != 0)
t |= TypeAttributes.Public;
if ((mod_flags & PRIVATE) != 0)
if ((mod_flags & ABSTRACT) != 0)
t |= TypeAttributes.Abstract;
+ return t;
+ }
+
+ public static TypeAttributes TypeAttr (int mod_flags, TypeContainer caller)
+ {
+ TypeAttributes t = TypeAttr (mod_flags, caller.IsTopLevel);
+
// If we do not have static constructors, static methods
// can be invoked without initializing the type.
if (!caller.HaveStaticConstructor)
if ((i & invalid_flags) == 0)
continue;
- Report.Error (106, l, "the modifier `" + Name (i) +
- "' is not valid for this item");
+ Error_InvalidModifier (l, Name (i));
}
return allowed & mod;
}
+
+ public static void Error_InvalidModifier (Location l, string name)
+ {
+ Report.Error (106, l, "the modifier " + name + " is not valid for this item");
+ }
}
}