// The parent member container and our member cache
IMemberContainer parent_container;
MemberCache member_cache;
-
+
//
// The indexer name for this class
//
if (parent == null)
n = "";
- else
+ else
n = parent.Name;
base_class_name = null;
-
+
//Console.WriteLine ("New class " + name + " inside " + n);
}
}
}
+ void Error_TypeParameterAsBase (TypeParameterExpr e)
+ {
+ Report.Error (
+ -213, e.Location,
+ String.Format ("Type parameter `{0}' can not be used t as a base class or interface", e.Name));
+ }
+
/// <remarks>
/// The pending methods that need to be implemented (interfaces or abstract methods)
/// </remarks>
return null;
}
+ if (name is TypeParameterExpr){
+ Error_TypeParameterAsBase ((TypeParameterExpr) name);
+ error = true;
+ return null;
+ }
+
Type first = name.Type;
if (first.IsClass){
}
}
+ if (IsGeneric && (parent == TypeManager.attribute_type ||
+ parent.IsSubclassOf (TypeManager.attribute_type))){
+ Report.Error (-214, Location, "Generic type can not derive from Attribute");
+ return null;
+ }
+
if (!is_class && TypeManager.value_type == null)
throw new Exception ();
}
}
-
}
public class Class : TypeContainer {
RootContext.MainClass == container.TypeBuilder.FullName)){
if (IsEntryPoint (MethodBuilder, ParameterInfo)) {
if (RootContext.EntryPoint == null) {
+ if (container.IsGeneric){
+ Report.Error (-201, Location,
+ "Entry point can not be defined in a generic class");
+ }
+
RootContext.EntryPoint = MethodBuilder;
RootContext.EntryPointLocation = Location;
} else {