// Holds the events
ArrayList events;
- // Holds AddHandlers stements for events
+ // Holds AddHandlers statements for events
ArrayList handlers;
// The emit context for toplevel objects.
if (value != null && (!(value is Method)))
return AdditionResult.NameExists;
- if (basename == Basename)
- return AdditionResult.EnclosingClash;
-
if (methods == null)
methods = new ArrayList ();
"'NotInheritable' class " + TypeManager.MonoBASIC_Name (parent));
if (!AsAccessible (parent, ModFlags))
- Report.Error (30389, Location,
+ Report.Error (30389, Location,
"Inconsistent accessibility: base class `" +
TypeManager.MonoBASIC_Name (parent) + "' is less " +
"accessible than class `" +
}
if (is_class == false && !t.IsInterface){
- Report.Error (527, "In Struct `" + Name + "', type `"+
+ Report.Error (527, Location, "In Struct `" + Name + "', type `"+
name +"' is not an interface");
error = true;
return null;
if (t.IsSealed) {
if (t.IsValueType)
- Report.Error (30258, "class `"+ Name +
+ Report.Error (30258, Location, "class `"+ Name +
"': a class can not inherit from a struct/enum");
- /*Report.Error (509, "class `"+ Name +
+ /*Report.Error (509, Location, "class `"+ Name +
"': Cannot inherit from sealed class `"+
bases [i]);*/
error = true;
if (t.IsClass) {
if (parent != null){
- Report.Error (30121, Name + ": A class cannot inherit " +
+ Report.Error (30121, Location, Name + ": A class cannot inherit " +
"more than one class");
error = true;
return null;
for (int x = 0; x < j; x++) {
if (t == ifaces [x]) {
- Report.Error (528, "`" + name + "' is already listed in interface list");
+ Report.Error (528,Location, "`" + name + "' is already listed in interface list");
error = true;
return null;
}
(base_class_type == TypeManager.attribute_type ||
base_class_type.IsSubclassOf (TypeManager.attribute_type))) {
RootContext.RegisterAttribute (this);
- } else
- RootContext.RegisterOrder (this);
+ }
+ else
+ {
+ if ( this is Interface)
+ RootContext.RegisterOrder ((Interface) this);
+ else
+ RootContext.RegisterOrder (this);
+ }
if (Interfaces != null) {
foreach (Interface iface in Interfaces)
foreach (Field f in fields) {
if ((f.ModFlags & Modifiers.PUBLIC) != 0)
continue;
+
+ if (f.Name.StartsWith(@"$STATIC$"))
+ continue;
if (f.status == 0){
Report.Warning (
if ((flags & Modifiers.PRIVATE) != 0){
if ((flags & vao) != 0){
Report.Error (
- 31408, loc, name +
+ 30266, loc, name +
": Members marked as Overridable or Overrides can not be Private");
ok = false;
}
WarningNotHiding (parent);*/
if ((ModFlags & Modifiers.OVERRIDE) != 0){
- Report.Error (30284, Location,
+ Report.Error (30398, Location,
parent.MakeName (Name) +
" : No suitable methods found to override");
}
TypeManager.ExpandAllInterfaces (tbases, ref bases);
foreach (Type tbase in bases) {
+ /*
string bname = tbase.Name;
if (bname.LastIndexOf(".") != -1)
bname = bname.Substring(bname.LastIndexOf("."));
+ */
- if (bname == iname) {
+ //if (bname == iname) {
+ if (tbase == InterfaceType) {
iface_found = true;
break;
}
TypeManager.MonoBASIC_Name (MemberType) + "' is less " +
"accessible than property `" + Name + "'");
else if (this is Method)
- Report.Error (50, Location,
+ Report.Error (30508, Location,
"Inconsistent accessibility: return type `" +
TypeManager.MonoBASIC_Name (MemberType) + "' is less " +
"accessible than method `" + Name + "'");
"' causes a cycle in the structure layout");
return false;
}
- FieldBuilder = parent.TypeBuilder.DefineField (
- Name, t, Modifiers.FieldAttr (ModFlags));
+
+ //Local Static Variable
+ if (Name.StartsWith(@"$STATIC$"))
+ FieldBuilder = parent.TypeBuilder.DefineField (
+ Name, t, Modifiers.FieldAttr (ModFlags) | FieldAttributes.SpecialName);
+ else
+ FieldBuilder = parent.TypeBuilder.DefineField (
+ Name, t, Modifiers.FieldAttr (ModFlags));
TypeManager.RegisterFieldBase (FieldBuilder, this);
return true;
if (mi != null && mi.Count > 0)
parent_member = (PropertyInfo) mi [0];
-
if (parent_member is PropertyInfo) {
PropertyInfo parent_property = (PropertyInfo)parent_member;
/*if ((ModFlags & Modifiers.NEW) != 0)
WarningNotHiding (container);
*/
- if ((ModFlags & Modifiers.OVERRIDE) != 0) {
-
- /*
- if (this is Indexer)
- Report.Error (115, Location,
- container.MakeName (Name) +
- " no suitable indexers found to override");
- else
- */
- Report.Error (115, Location,
- container.MakeName (Name) +
- " no suitable properties found to override");
- return false;
- }
if ((ModFlags & ( Modifiers.NEW | Modifiers.SHADOWS | Modifiers.OVERRIDE )) == 0) {
if ((ModFlags & Modifiers.NONVIRTUAL) != 0) {
Modifiers.WRITEONLY |
Modifiers.SHADOWS;
- string set_parameter_name;
- Parameters get_params;
- Parameters set_params;
+ //string set_parameter_name;
+ //Parameters get_params;
+ //Parameters set_params;
public Property (Expression type, string name, int mod_flags,
Accessor get_block, Accessor set_block,
"'Property' inside a 'Structure' can not be declared as " +
"'Protected' or 'Protected Friend'");
+ if (((ModFlags & Modifiers.DEFAULT) != 0) && (Parameters == null || Parameters.CountStandardParams () == 0)) {
+ Report.Error (31048, Location, "Properties with no required " +
+ "parameters cannot be declared 'Default'");
+ return false;
+ }
+
if (!DoDefine (parent))
return false;