+2005-02-08 Raja R Harinath <rharinath@novell.com>
+
+ Fix #72015.
+ * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
+ TypeManager.multicast_delegate_type is null, resolve it by looking
+ up "System.MulticastDelegate".
+ * rootcontext.cs (RootContext.ResolveCore): Simplify.
+
2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
TypeAttributes attr = Modifiers.TypeAttr (ModFlags, IsTopLevel) |
TypeAttributes.Class | TypeAttributes.Sealed;
+ if (TypeManager.multicast_delegate_type == null && !RootContext.StdLib) {
+ TypeExpr expr = new TypeLookupExpression ("System.MulticastDelegate");
+ TypeManager.multicast_delegate_type = expr.ResolveType (ec);
+ }
+
if (TypeManager.multicast_delegate_type == null)
- Report.Error (-100, Location, "Internal error: delegate used before " +
- "System.MulticastDelegate is resolved. This can only " +
- "happen during corlib compilation, when using a delegate " +
- "in any of the `core' classes. See bug #72015 for details.");
+ throw new InternalErrorException ("System.MulticastDelegate unresolved");
if (IsTopLevel) {
if (TypeManager.NamespaceClash (Name, Location))
{
MethodAttributes mattr;
int i;
- ec = new EmitContext (this, this, Location, null, null, ModFlags, false);
+
+ if (ec == null)
+ throw new InternalErrorException ("Define called before DefineType?");
// FIXME: POSSIBLY make this static, as it is always constant
//
// These are classes that depends on the core interfaces
//
string [] classes_second_stage = {
+ "System.Enum",
+ "System.String",
+ "System.Array",
"System.Reflection.MemberInfo",
"System.Type",
"System.Exception",
"System.Security.CodeAccessPermission"
};
- // We must store them here before calling BootstrapCorlib_ResolveDelegate.
- TypeManager.string_type = BootstrapCorlib_ResolveClass (root, "System.String");
- TypeManager.enum_type = BootstrapCorlib_ResolveClass (root, "System.Enum");
- TypeManager.array_type = BootstrapCorlib_ResolveClass (root, "System.Array");
- TypeManager.multicast_delegate_type = BootstrapCorlib_ResolveClass (root, "System.MulticastDelegate");
- TypeManager.delegate_type = BootstrapCorlib_ResolveClass (root, "System.Delegate");
-
foreach (string cname in classes_second_stage)
BootstrapCorlib_ResolveClass (root, cname);
BootstrapCorlib_ResolveDelegate (root, "System.AsyncCallback");
+
+ // These will be defined indirectly during the previous ResolveDelegate.
+ // However make sure the rest of the checks happen.
+ string [] delegate_types = { "System.Delegate", "System.MulticastDelegate" };
+ foreach (string cname in delegate_types)
+ BootstrapCorlib_ResolveClass (root, cname);
}
// <summary>