types.Add (c);
// FIXME: Do we really need to explicitly add an empty default static constructor?
- if (c.default_static_constructor == null)
+ // Apparently we don't
+/* if (c.default_static_constructor == null)
{
bool isModule = c is Mono.MonoBASIC.Module;
Constructor dc = new Constructor ("New", Parameters.EmptyReadOnlyParameters, null, c.Location);
dc.ModFlags = isModule ? Modifiers.PUBLIC | Modifiers.STATIC : Modifiers.PUBLIC;
c.AddConstructor (dc);
- }
+ }
+*/
// --------------------------------------------------------------
return AdditionResult.Success;
Modifiers.ABSTRACT |
Modifiers.SEALED |
Modifiers.UNSAFE;
-
+
public Class (TypeContainer parent, string name, int mod, Attributes attrs, Location l)
: base (parent, name, l)
{
if (Name == "Main" &&
((ModFlags & Modifiers.STATIC) != 0) &&
(RootContext.MainClass == null ||
- RootContext.MainClass == parent.TypeBuilder.FullName)){
+ RootContext.MainClass == parent.TypeBuilder.FullName ||
+ (RootContext.RootNamespace != null &&
+ RootContext.RootNamespace.Length > 0 &&
+ (RootContext.RootNamespace + "." + RootContext.MainClass) == parent.TypeBuilder.FullName))) {
if (IsEntryPoint (MethodBuilder, ParameterInfo)) {
if (RootContext.EntryPoint == null) {
RootContext.EntryPoint = MethodBuilder;
loc);
if (parent_constructor_group == null){
- Report.Error (1501, loc,
- "Can not find a constructor for this argument list");
+ string s = String.Format ("'{0}': Can not find a constructor for this argument list", t);
+ Report.Error (1501, loc, s);
return false;
}
-
+
parent_constructor = (ConstructorInfo) Invocation.OverloadResolve (ec,
(MethodGroupExpr) parent_constructor_group, argument_list, loc);
if (parent_constructor == null){
- Report.Error (1501, loc,
- "Can not find a constructor for this argument list");
+ string s = String.Format ("'{0}': Can not find a constructor for this argument list", t);
+ Report.Error (1501, loc, s);
return false;
}
return true;
}
- public void Emit (TypeContainer tc)
+ public virtual void Emit (TypeContainer tc)
{
//
// The PropertyBuilder can be null for explicit implementations, in that
return true;
}
- public void Emit (TypeContainer tc)
+ public override void Emit (TypeContainer tc)
{
base.Emit (tc);